{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/reason/issues/1232","repository_url":"https://api.github.com/repos/facebook/reason","labels_url":"https://api.github.com/repos/facebook/reason/issues/1232/labels{/name}","comments_url":"https://api.github.com/repos/facebook/reason/issues/1232/comments","events_url":"https://api.github.com/repos/facebook/reason/issues/1232/events","html_url":"https://github.com/facebook/reason/issues/1232","id":223979699,"number":1232,"title":"Explanatory appending-to-list error message","user":{"login":"sgrove","id":35296,"avatar_url":"https://avatars1.githubusercontent.com/u/35296?v=3","gravatar_id":"","url":"https://api.github.com/users/sgrove","html_url":"https://github.com/sgrove","followers_url":"https://api.github.com/users/sgrove/followers","following_url":"https://api.github.com/users/sgrove/following{/other_user}","gists_url":"https://api.github.com/users/sgrove/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrove/subscriptions","organizations_url":"https://api.github.com/users/sgrove/orgs","repos_url":"https://api.github.com/users/sgrove/repos","events_url":"https://api.github.com/users/sgrove/events{/privacy}","received_events_url":"https://api.github.com/users/sgrove/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-24T23:32:39Z","updated_at":"2017-04-24T23:44:07Z","closed_at":null,"body":"This works: \r\n\r\n`let newCards = [card, ...otherCards];`\r\n\r\nwhile this \r\n\r\n`let newCards = [...otherCards, card];`\r\n\r\nthrows \r\n```\r\nrefmt errors:\r\nFile \"example.re\", line 147, characters 39-40:\r\nError: 2226: <UNKNOWN SYNTAX ERROR>\r\n```\r\n\r\nProbably it could be recognized and turned into, \r\n\r\n> It looks like you're trying to append an item to the tail of a list, which isn't supported in the default list data structure because it can be very slow. If you *really* want to do this, try `[[otherCards], card];` (but read https://facebook.github.io/reason/ on why this might not be a good idea!)\r\n\r\nOr\r\n\r\n> `[...otherCards, card]` should be written as `[[otherCards], card]`\r\n>  But appending to the tail of a list can be very slow! If you *really* want to do this, read https://facebook.github.io/reason/ on why this might not be a good idea and on alternatives!"},"comment":{"url":"https://api.github.com/repos/facebook/reason/issues/comments/296851718","html_url":"https://github.com/facebook/reason/issues/1232#issuecomment-296851718","issue_url":"https://api.github.com/repos/facebook/reason/issues/1232","id":296851718,"user":{"login":"Schmavery","id":2154522,"avatar_url":"https://avatars2.githubusercontent.com/u/2154522?v=3","gravatar_id":"","url":"https://api.github.com/users/Schmavery","html_url":"https://github.com/Schmavery","followers_url":"https://api.github.com/users/Schmavery/followers","following_url":"https://api.github.com/users/Schmavery/following{/other_user}","gists_url":"https://api.github.com/users/Schmavery/gists{/gist_id}","starred_url":"https://api.github.com/users/Schmavery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schmavery/subscriptions","organizations_url":"https://api.github.com/users/Schmavery/orgs","repos_url":"https://api.github.com/users/Schmavery/repos","events_url":"https://api.github.com/users/Schmavery/events{/privacy}","received_events_url":"https://api.github.com/users/Schmavery/received_events","type":"User","site_admin":false},"created_at":"2017-04-24T23:44:07Z","updated_at":"2017-04-24T23:44:07Z","body":"Will `[[otherCards], card]` really be what they're expecting?  I would have expected something more like `otherCards @ [card]`.  Might be worth linking to a specific place with an explanation if we're going to link, I couldn't find any explanation at the suggested link after a little looking."}}
{"actor":{"display_login":"Schmavery"}}