3092700876ae00aa40e0943fc8899ea3f91363fc 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. function {
  8. name {
  9. name: "map"
  10. }
  11. deduced_parameters {
  12. name: "T"
  13. type {
  14. type_type_literal {
  15. }
  16. }
  17. }
  18. param_pattern {
  19. fields {
  20. binding_pattern {
  21. name: "f"
  22. type {
  23. expression_pattern {
  24. expression {
  25. function_type {
  26. return_type {
  27. identifier {
  28. name: "T"
  29. }
  30. }
  31. parameter {
  32. fields {
  33. identifier {
  34. name: "T"
  35. }
  36. }
  37. }
  38. }
  39. }
  40. }
  41. }
  42. }
  43. }
  44. fields {
  45. binding_pattern {
  46. name: "tuple"
  47. type {
  48. expression_pattern {
  49. expression {
  50. tuple_literal {
  51. fields {
  52. identifier {
  53. name: "T"
  54. }
  55. }
  56. fields {
  57. identifier {
  58. name: "T"
  59. }
  60. }
  61. }
  62. }
  63. }
  64. }
  65. }
  66. }
  67. }
  68. return_term {
  69. kind: Expression
  70. type {
  71. tuple_literal {
  72. fields {
  73. identifier {
  74. name: "T"
  75. }
  76. }
  77. fields {
  78. identifier {
  79. name: "T"
  80. }
  81. }
  82. }
  83. }
  84. }
  85. body {
  86. statements {
  87. return_expression_statement {
  88. expression {
  89. tuple_literal {
  90. fields {
  91. call {
  92. function {
  93. identifier {
  94. name: "f"
  95. }
  96. }
  97. argument {
  98. tuple_literal {
  99. fields {
  100. index {
  101. object {
  102. identifier {
  103. name: "tuple"
  104. }
  105. }
  106. offset {
  107. int_literal {
  108. value: 0
  109. }
  110. }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. }
  117. fields {
  118. call {
  119. function {
  120. identifier {
  121. name: "f"
  122. }
  123. }
  124. argument {
  125. tuple_literal {
  126. fields {
  127. index {
  128. object {
  129. identifier {
  130. name: "tuple"
  131. }
  132. }
  133. offset {
  134. int_literal {
  135. value: 1
  136. }
  137. }
  138. }
  139. }
  140. }
  141. }
  142. }
  143. }
  144. }
  145. }
  146. }
  147. }
  148. }
  149. }
  150. }
  151. declarations {
  152. function {
  153. name {
  154. name: "inc"
  155. }
  156. param_pattern {
  157. fields {
  158. binding_pattern {
  159. name: "x"
  160. type {
  161. expression_pattern {
  162. expression {
  163. int_type_literal {
  164. }
  165. }
  166. }
  167. }
  168. }
  169. }
  170. }
  171. return_term {
  172. kind: Expression
  173. type {
  174. int_type_literal {
  175. }
  176. }
  177. }
  178. body {
  179. statements {
  180. return_expression_statement {
  181. expression {
  182. operator {
  183. op: Add
  184. arguments {
  185. identifier {
  186. name: "x"
  187. }
  188. }
  189. arguments {
  190. int_literal {
  191. value: 1
  192. }
  193. }
  194. }
  195. }
  196. }
  197. }
  198. }
  199. }
  200. }
  201. declarations {
  202. function {
  203. name {
  204. name: "Main"
  205. }
  206. param_pattern {
  207. }
  208. return_term {
  209. kind: Expression
  210. type {
  211. int_type_literal {
  212. }
  213. }
  214. }
  215. body {
  216. statements {
  217. return_expression_statement {
  218. expression {
  219. index {
  220. object {
  221. call {
  222. function {
  223. identifier {
  224. name: "map"
  225. }
  226. }
  227. argument {
  228. tuple_literal {
  229. fields {
  230. identifier {
  231. name: "inc"
  232. }
  233. }
  234. fields {
  235. tuple_literal {
  236. fields {
  237. int_literal {
  238. value: 0
  239. }
  240. }
  241. fields {
  242. int_literal {
  243. value: 2
  244. }
  245. }
  246. }
  247. }
  248. }
  249. }
  250. }
  251. }
  252. offset {
  253. int_literal {
  254. value: 0
  255. }
  256. }
  257. }
  258. }
  259. }
  260. }
  261. }
  262. }
  263. }
  264. }