{"action":"created","issue":{"url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/22","repository_url":"https://api.github.com/repos/stoeffel/elm-doc-test","labels_url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/22/comments","events_url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/22/events","html_url":"https://github.com/stoeffel/elm-doc-test/pull/22","id":233596721,"number":22,"title":"Proposal new dsl (WIP)","user":{"login":"stoeffel","id":1217681,"avatar_url":"https://avatars0.githubusercontent.com/u/1217681?v=3","gravatar_id":"","url":"https://api.github.com/users/stoeffel","html_url":"https://github.com/stoeffel","followers_url":"https://api.github.com/users/stoeffel/followers","following_url":"https://api.github.com/users/stoeffel/following{/other_user}","gists_url":"https://api.github.com/users/stoeffel/gists{/gist_id}","starred_url":"https://api.github.com/users/stoeffel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoeffel/subscriptions","organizations_url":"https://api.github.com/users/stoeffel/orgs","repos_url":"https://api.github.com/users/stoeffel/repos","events_url":"https://api.github.com/users/stoeffel/events{/privacy}","received_events_url":"https://api.github.com/users/stoeffel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2017-06-05T13:59:32Z","updated_at":"2017-06-06T11:20:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/stoeffel/elm-doc-test/pulls/22","html_url":"https://github.com/stoeffel/elm-doc-test/pull/22","diff_url":"https://github.com/stoeffel/elm-doc-test/pull/22.diff","patch_url":"https://github.com/stoeffel/elm-doc-test/pull/22.patch"},"body":"This changes the current dsl to use `-->` in between assertion and expectation.\r\ni.e.\r\n```elm\r\n{-| returns the sum of a list of int\r\n\r\n    sum aList -- no expectation, this is not a test\r\n\r\n    sum\r\n        [ 41\r\n        , 1\r\n        ]\r\n    --> 42\r\n\r\n    sum [1, 2] --> 3\r\n-}\r\nsum : List Int -> Int\r\nsum =\r\n    List.foldl (+) 0\r\n```\r\n\r\nThis way we end up with nicer docs on package.elm-lang.org.\r\n### basic usage\r\n<details><summary>before</summary>\r\n<img width=\"615\" alt=\"screen shot 2017-06-05 at 15 52 05\" src=\"https://cloud.githubusercontent.com/assets/1217681/26786442/f690a5e4-4a06-11e7-8c3d-b63a3275ee6b.png\">\r\n\r\n</details>\r\n<details><summary>after (with a oneliner example)</summary>\r\n<img width=\"611\" alt=\"screen shot 2017-06-05 at 15 53 45\" src=\"https://cloud.githubusercontent.com/assets/1217681/26786515/2fef8710-4a07-11e7-914b-cfe0f9edea72.png\">\r\n\r\n</details>\r\n\r\n### multiline assertion\r\n<details><summary>before</summary>\r\n<img width=\"634\" alt=\"screen shot 2017-06-05 at 15 50 44\" src=\"https://cloud.githubusercontent.com/assets/1217681/26786547/4b07d8ae-4a07-11e7-8684-258eb5480cf1.png\">\r\n\r\n</details>\r\n<details><summary>after (with an additional example that doesn't have an expectation)</summary>\r\n<img width=\"620\" alt=\"screen shot 2017-06-05 at 15 55 00\" src=\"https://cloud.githubusercontent.com/assets/1217681/26786567/5b62fd8c-4a07-11e7-826b-0576fc326cb8.png\">\r\n</details>\r\n\r\n### multiline expectation\r\n<details><summary>before</summary>\r\n<img width=\"605\" alt=\"screen shot 2017-06-05 at 15 50 22\" src=\"https://cloud.githubusercontent.com/assets/1217681/26786636/990a0522-4a07-11e7-9736-6b282bb37722.png\">\r\n\r\n\r\n</details>\r\n<details><summary>after</summary>\r\n<img width=\"612\" alt=\"screen shot 2017-06-05 at 15 49 49\" src=\"https://cloud.githubusercontent.com/assets/1217681/26786666/a63b9dd2-4a07-11e7-9565-439686e42828.png\">\r\n\r\n</details>\r\n\r\n### Global imports\r\n\r\nImported in top comment of a module\r\n<img width=\"624\" alt=\"screen shot 2017-06-05 at 15 49 43\" src=\"https://cloud.githubusercontent.com/assets/1217681/26786694/bbaaa0b4-4a07-11e7-95da-c6e085b567e7.png\">\r\n\r\n### Imports before example\r\n\r\n<img width=\"619\" alt=\"screen shot 2017-06-05 at 15 49 38\" src=\"https://cloud.githubusercontent.com/assets/1217681/26786705/c8116b44-4a07-11e7-9fd5-f16af6ca10d2.png\">\r\n\r\n\r\n### Pros:\r\n* nicer docs (see screenshots)\r\n* oneliners\r\n* allows for examples that don't have an expectation, and it doesn't look weird combined\r\n* `-->` arrow is expressive\r\n\r\n### Cons: \r\n* breaking change\r\n* less familiar for people coming from python or other languages which have doc-tests."},"comment":{"url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/comments/306456627","html_url":"https://github.com/stoeffel/elm-doc-test/pull/22#issuecomment-306456627","issue_url":"https://api.github.com/repos/stoeffel/elm-doc-test/issues/22","id":306456627,"user":{"login":"cuducos","id":4732915,"avatar_url":"https://avatars1.githubusercontent.com/u/4732915?v=3","gravatar_id":"","url":"https://api.github.com/users/cuducos","html_url":"https://github.com/cuducos","followers_url":"https://api.github.com/users/cuducos/followers","following_url":"https://api.github.com/users/cuducos/following{/other_user}","gists_url":"https://api.github.com/users/cuducos/gists{/gist_id}","starred_url":"https://api.github.com/users/cuducos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuducos/subscriptions","organizations_url":"https://api.github.com/users/cuducos/orgs","repos_url":"https://api.github.com/users/cuducos/repos","events_url":"https://api.github.com/users/cuducos/events{/privacy}","received_events_url":"https://api.github.com/users/cuducos/received_events","type":"User","site_admin":false},"created_at":"2017-06-06T11:20:37Z","updated_at":"2017-06-06T11:20:37Z","body":"> The Markdown parser always treats the second paragraph as code (because it's indented), so this doesn't work regardless of whether you're writing doctests.\r\n\r\nThanks @rtfeldman — my mental compiler was buggy and I haven't considered that. So… well… probably @stoeffel know better than me if the `>>>` is really a problem for beginners. I still thing it's expressive in reinforcing that the line is code… **but** as I come from a Python background this is totally biased, I admit it.\r\n\r\nSo let's embrace the new DSL and – hell yeah – one liners ; ) I know this might sound ironic but it's not. New syntax is expressive for expectations, beautiful in docs, and way better for imports (even if that is discussed in the new topic)."}}
{"actor":{"display_login":"cuducos"}}