{"action":"closed","issue":{"url":"https://api.github.com/repos/f-o-a-m/purescript-web3-generator/issues/41","repository_url":"https://api.github.com/repos/f-o-a-m/purescript-web3-generator","labels_url":"https://api.github.com/repos/f-o-a-m/purescript-web3-generator/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/f-o-a-m/purescript-web3-generator/issues/41/comments","events_url":"https://api.github.com/repos/f-o-a-m/purescript-web3-generator/issues/41/events","html_url":"https://github.com/f-o-a-m/purescript-web3-generator/issues/41","id":314356972,"number":41,"title":"Deep nested types of `Vector n a` slows down (or maybe kills) `psc`","user":{"login":"sectore","id":47693,"avatar_url":"https://avatars1.githubusercontent.com/u/47693?v=4","gravatar_id":"","url":"https://api.github.com/users/sectore","html_url":"https://github.com/sectore","followers_url":"https://api.github.com/users/sectore/followers","following_url":"https://api.github.com/users/sectore/following{/other_user}","gists_url":"https://api.github.com/users/sectore/gists{/gist_id}","starred_url":"https://api.github.com/users/sectore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sectore/subscriptions","organizations_url":"https://api.github.com/users/sectore/orgs","repos_url":"https://api.github.com/users/sectore/repos","events_url":"https://api.github.com/users/sectore/events{/privacy}","received_events_url":"https://api.github.com/users/sectore/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-04-14T19:53:25Z","updated_at":"2018-04-19T12:48:27Z","closed_at":"2018-04-19T12:48:27Z","author_association":"CONTRIBUTOR","body":"As an example here is random function `getAdopters()` written in `Solidity`\r\n```solidity\r\naddress[16] public adopters;\r\n\r\nfunction getAdopters() public view returns (address[16]) {\r\n  return adopters;\r\n}\r\n```\r\nIt will be generated into `PureScript` as follow:\r\n```purescript\r\ntype GetAdoptersFn = Tagged (SProxy \"getAdopters()\") (Tuple0 )\r\n\r\ngetAdopters :: forall e. TransactionOptions NoPay -> ChainCursor -> Web3 e (Either CallError (Vector (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (Z))))))))))))))))) Address))\r\ngetAdopters x0 cm = map unTuple1 <$> call x0 cm ((tagged $ Tuple0 ) :: GetAdoptersFn)\r\n```\r\n\r\nFrom a code _point of view_ everything is fine! However, the needed recursion to interpret that deep nested `(Vector (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (S (Z))))))))))))))))) Address)` type slows down `psc` and seems to kill it. In the example above ^ I could not compile the code anymore if a `Vector` has a size `> 14`.\r\n\r\nThe usage of `type` aliases  [`N1 .. N16`](https://github.com/f-o-a-m/purescript-web3/blob/master/src/Network/Ethereum/Web3/Solidity/Size.purs#L152-L168) could be a workaround. For example `(Vector N16 Address)` in my case. But then all `Vector`'s would have limited sizes of `1`..`16` and there might be a better solution. _I will think about it again..._.\r\n\r\n"}}
{"actor":{"display_login":"safareli"}}