fork(1) download
  1. --[[
  2. fn _ =>
  3.   let id = fn x => x in
  4.   let const = fn x => fn _ => x in
  5.   let compose = fn f => fn g => fn x => f (g x) in
  6.   compose id const 42 12
  7. --]]
  8. function _styx_builtin_if(c)
  9. return function(t)
  10. return function(f)
  11. if c then
  12. return t()
  13. else
  14. return f()
  15. end
  16. end
  17. end
  18. end
  19. f12 = {
  20. __call = function(self, p)
  21. local v1 = self['c1']
  22. local v2 = self['c2']
  23. local v3 = self['c3']
  24. local v4 = p
  25. local v5 = v4(v2)
  26. local v6 = v5(v3)
  27. local v7 = 42
  28. local v8 = v6(v7)
  29. local v9 = 12
  30. local v10 = v8(v9)
  31. return v10
  32. end
  33. }
  34. f46 = {
  35. __call = function(self, p)
  36. local v1 = self['c1']
  37. local v44 = p
  38. return v44
  39. end
  40. }
  41. f23 = {
  42. __call = function(self, p)
  43. local v1 = self['c1']
  44. local v2 = self['c2']
  45. local v3 = self['c3']
  46. local v14 = self['c14']
  47. local v15 = p
  48. local v21 = {
  49. c14 = v14,
  50. c2 = v2,
  51. c3 = v3,
  52. c15 = v15,
  53. c1 = v1,
  54. }
  55. setmetatable(v21, f20)
  56. return v21
  57. end
  58. }
  59. f30 = {
  60. __call = function(self, p)
  61. local v1 = self['c1']
  62. local v2 = self['c2']
  63. local v3 = p
  64. local v13 = {
  65. c1 = v1,
  66. c2 = v2,
  67. c3 = v3,
  68. }
  69. setmetatable(v13, f12)
  70. local v27 = {
  71. c1 = v1,
  72. c2 = v2,
  73. c3 = v3,
  74. }
  75. setmetatable(v27, f26)
  76. local v28 = v13(v27)
  77. return v28
  78. end
  79. }
  80. f20 = {
  81. __call = function(self, p)
  82. local v14 = self['c14']
  83. local v2 = self['c2']
  84. local v3 = self['c3']
  85. local v15 = self['c15']
  86. local v1 = self['c1']
  87. local v16 = p
  88. local v17 = v15(v16)
  89. local v18 = v14(v17)
  90. return v18
  91. end
  92. }
  93. f50 = {
  94. __call = function(self, p)
  95. local v1 = p
  96. local v43 = {
  97. c1 = v1,
  98. }
  99. setmetatable(v43, f42)
  100. local v47 = {
  101. c1 = v1,
  102. }
  103. setmetatable(v47, f46)
  104. local v48 = v43(v47)
  105. return v48
  106. end
  107. }
  108. f42 = {
  109. __call = function(self, p)
  110. local v1 = self['c1']
  111. local v2 = p
  112. local v31 = {
  113. c1 = v1,
  114. c2 = v2,
  115. }
  116. setmetatable(v31, f30)
  117. local v39 = {
  118. c1 = v1,
  119. c2 = v2,
  120. }
  121. setmetatable(v39, f38)
  122. local v40 = v31(v39)
  123. return v40
  124. end
  125. }
  126. f38 = {
  127. __call = function(self, p)
  128. local v1 = self['c1']
  129. local v2 = self['c2']
  130. local v32 = p
  131. local v36 = {
  132. c1 = v1,
  133. c2 = v2,
  134. c32 = v32,
  135. }
  136. setmetatable(v36, f35)
  137. return v36
  138. end
  139. }
  140. f35 = {
  141. __call = function(self, p)
  142. local v1 = self['c1']
  143. local v2 = self['c2']
  144. local v32 = self['c32']
  145. local v33 = p
  146. return v32
  147. end
  148. }
  149. f26 = {
  150. __call = function(self, p)
  151. local v1 = self['c1']
  152. local v2 = self['c2']
  153. local v3 = self['c3']
  154. local v14 = p
  155. local v24 = {
  156. c1 = v1,
  157. c2 = v2,
  158. c3 = v3,
  159. c14 = v14,
  160. }
  161. setmetatable(v24, f23)
  162. return v24
  163. end
  164. }
  165.  
  166. local main = {}
  167. setmetatable(main, f50)
  168.  
  169. print(main(nil))
Success #stdin #stdout 0.01s 2496KB
stdin
Standard input is empty
stdout
42