{"action":"created","issue":{"url":"https://api.github.com/repos/evancz/elm-architecture-tutorial/issues/65","repository_url":"https://api.github.com/repos/evancz/elm-architecture-tutorial","labels_url":"https://api.github.com/repos/evancz/elm-architecture-tutorial/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/evancz/elm-architecture-tutorial/issues/65/comments","events_url":"https://api.github.com/repos/evancz/elm-architecture-tutorial/issues/65/events","html_url":"https://github.com/evancz/elm-architecture-tutorial/issues/65","id":134147555,"number":65,"title":"Example 4 uses unfamiliar syntax to create Counter.Context","user":{"login":"Josh211ua","id":1074575,"avatar_url":"https://avatars.githubusercontent.com/u/1074575?v=3","gravatar_id":"","url":"https://api.github.com/users/Josh211ua","html_url":"https://github.com/Josh211ua","followers_url":"https://api.github.com/users/Josh211ua/followers","following_url":"https://api.github.com/users/Josh211ua/following{/other_user}","gists_url":"https://api.github.com/users/Josh211ua/gists{/gist_id}","starred_url":"https://api.github.com/users/Josh211ua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Josh211ua/subscriptions","organizations_url":"https://api.github.com/users/Josh211ua/orgs","repos_url":"https://api.github.com/users/Josh211ua/repos","events_url":"https://api.github.com/users/Josh211ua/events{/privacy}","received_events_url":"https://api.github.com/users/Josh211ua/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-17T01:18:57Z","updated_at":"2016-04-09T20:25:49Z","closed_at":null,"body":"In example 4, the CounterList creates a Counter.Context record using the syntax:\r\n\r\n```elm\r\nlet context =\r\n      Counter.Context\r\n        (Signal.forwardTo address (Modify id))\r\n        (Signal.forwardTo address (always (Remove id)))\r\n```\r\n\r\nAs someone who is new to elm this syntax left me somewhat confused. `Counter.Context` is a type alias and it was not obvious to me that a type alias could be used to construct a record of that type. I have since confirmed that this is the case, but was unable to find documentation about this.\r\n\r\nThe example would have been slightly simpler for me to follow if it had avoided or explained this new syntax. It seems easy to avoid by changing the example to:\r\n```elm\r\nlet context =\r\n      {\r\n        actions = (Signal.forwardTo address (Modify id))\r\n        remove = (Signal.forwardTo address (always (Remove id)))\r\n      }\r\n```"},"comment":{"url":"https://api.github.com/repos/evancz/elm-architecture-tutorial/issues/comments/207848573","html_url":"https://github.com/evancz/elm-architecture-tutorial/issues/65#issuecomment-207848573","issue_url":"https://api.github.com/repos/evancz/elm-architecture-tutorial/issues/65","id":207848573,"user":{"login":"homanchou","id":128769,"avatar_url":"https://avatars.githubusercontent.com/u/128769?v=3","gravatar_id":"","url":"https://api.github.com/users/homanchou","html_url":"https://github.com/homanchou","followers_url":"https://api.github.com/users/homanchou/followers","following_url":"https://api.github.com/users/homanchou/following{/other_user}","gists_url":"https://api.github.com/users/homanchou/gists{/gist_id}","starred_url":"https://api.github.com/users/homanchou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/homanchou/subscriptions","organizations_url":"https://api.github.com/users/homanchou/orgs","repos_url":"https://api.github.com/users/homanchou/repos","events_url":"https://api.github.com/users/homanchou/events{/privacy}","received_events_url":"https://api.github.com/users/homanchou/received_events","type":"User","site_admin":false},"created_at":"2016-04-09T20:25:49Z","updated_at":"2016-04-09T20:25:49Z","body":"Nope, order appears to matter:\r\n\r\nthis works:\r\n\r\n```\r\n> type alias Context = {int: Int, string: String}\r\n\r\n> test = Context 3 \"correct\"\r\n{ $int = 3, string = \"correct\" } : Repl.Context\r\n> test.int\r\n3 : Int\r\n> test.string\r\n\"correct\" : String\r\n\r\n````\r\n\r\nthis does not work\r\n\r\n````\r\n\r\n> Context \"incorrect\" 3\r\n-- TYPE MISMATCH --------------------------------------------- repl-temp-000.elm\r\n\r\nThe 1st argument to function `Context` is causing a mismatch.\r\n\r\n4│   Context \"incorrect\" 3\r\n             ^^^^^^^^^^^\r\nFunction `Context` is expecting the 1st argument to be:\r\n\r\n    Int\r\n\r\nBut it is:\r\n\r\n    String\r\n\r\n\r\n>\r\n```"}}