Advertisement
Guest User

ghc core

a guest
Aug 28th, 2021
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.78 KB | None | 0 0
  1. ==================== Tidy Core ====================
  2. Result size of Tidy Core
  3. = {terms: 155, types: 289, coercions: 37, joins: 1/3}
  4.  
  5. -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
  6. $trModule4 :: Addr#
  7. $trModule4 = "main"#
  8.  
  9. -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
  10. $trModule3 :: TrName
  11. $trModule3 = TrNameS $trModule4
  12.  
  13. -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
  14. $trModule2 :: Addr#
  15. $trModule2 = "Main"#
  16.  
  17. -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
  18. $trModule1 :: TrName
  19. $trModule1 = TrNameS $trModule2
  20.  
  21. -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
  22. $trModule :: Module
  23. $trModule = Module $trModule3 $trModule1
  24.  
  25. -- RHS size: {terms: 133, types: 259, coercions: 28, joins: 1/3}
  26. main1 :: State# RealWorld -> (# State# RealWorld, () #)
  27. main1
  28. = \ (s :: State# RealWorld) ->
  29. case newMutVar# (I# 0#) s of { (# ipv, ipv1 #) ->
  30. case async2
  31. rawForkIO
  32. (letrec {
  33. loop1 :: State# RealWorld -> (# State# RealWorld, Any #)
  34. loop1
  35. = \ (s1 :: State# RealWorld) ->
  36. case readMutVar# ipv1 s1 of { (# ipv2, ipv3 #) ->
  37. case {__pkg_ccall base-4.13.0.0 State# RealWorld
  38. -> (# State# RealWorld, Int# #)}
  39. realWorld#
  40. of
  41. { (# ds2, ds3 #) ->
  42. join {
  43. $w$j :: State# RealWorld -> (# State# RealWorld, Any #)
  44. $w$j (w :: State# RealWorld)
  45. = case writeMutVar# ipv1 (case ipv3 of { I# x -> I# (+# x 1#) }) w
  46. of s2#
  47. { __DEFAULT ->
  48. case ipv3 of { I# x ->
  49. case ># x 10000000# of {
  50. __DEFAULT -> case loop1 s2# of { (# ipv4, ipv5 #) -> loop1 ipv4 };
  51. 1# ->
  52. case error
  53. ((PushCallStack
  54. (unpackCString# "error"#)
  55. (SrcLoc
  56. (unpackCString# $trModule4)
  57. (unpackCString# $trModule2)
  58. (unpackCString# "Leak2.hs"#)
  59. (I# 17#)
  60. (I# 21#)
  61. (I# 17#)
  62. (I# 33#))
  63. EmptyCallStack)
  64. `cast` <Co:4>)
  65. (unpackCString# "done"#)
  66. of wild2 {
  67. }
  68. }
  69. }
  70. } } in
  71. case ds3 of {
  72. __DEFAULT ->
  73. case threadDelay1 (I# 1#) ipv2 of { (# ipv4, ipv5 #) ->
  74. jump $w$j ipv4
  75. };
  76. 0# -> case delay# 1# ipv2 of s' { __DEFAULT -> jump $w$j s' }
  77. }
  78. }
  79. }; } in
  80. loop1 `cast` <Co:5>)
  81. ipv
  82. of
  83. { (# ipv2, ipv3 #) ->
  84. let {
  85. f :: STM (Either SomeException Any)
  86. f = case ipv3 of { Async dt w -> w } } in
  87. case catch#
  88. (atomically# (f `cast` <Co:6>))
  89. (\ (e1 :: SomeException) (eta :: State# RealWorld) ->
  90. case e1 of wild { SomeException @ e2 $dException1 e3 ->
  91. case eqTypeRep
  92. (($p1Exception $dException1) `cast` <Co:4>)
  93. $fExceptionBlockedIndefinitelyOnSTM3
  94. of {
  95. Nothing -> raiseIO# wild eta;
  96. Just ds2 ->
  97. case ds2 of { HRefl co co1 ->
  98. case e3 `cast` <Co:3> of { BlockedIndefinitelyOnSTM ->
  99. atomically# (f `cast` <Co:6>) eta
  100. }
  101. }
  102. }
  103. })
  104. ipv2
  105. of
  106. { (# ipv4, ipv5 #) ->
  107. (# ipv4, () #)
  108. }
  109. }
  110. }
  111.  
  112. -- RHS size: {terms: 1, types: 0, coercions: 3, joins: 0/0}
  113. main :: IO ()
  114. main = main1 `cast` <Co:3>
  115.  
  116. -- RHS size: {terms: 2, types: 1, coercions: 3, joins: 0/0}
  117. main2 :: State# RealWorld -> (# State# RealWorld, () #)
  118. main2 = runMainIO1 (main1 `cast` <Co:3>)
  119.  
  120. -- RHS size: {terms: 1, types: 0, coercions: 3, joins: 0/0}
  121. main :: IO ()
  122. main = main2 `cast` <Co:3>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement