{"action":"created","issue":{"url":"https://api.github.com/repos/avh4/elm-format/issues/115","labels_url":"https://api.github.com/repos/avh4/elm-format/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/avh4/elm-format/issues/115/comments","events_url":"https://api.github.com/repos/avh4/elm-format/issues/115/events","html_url":"https://github.com/avh4/elm-format/issues/115","id":127336636,"number":115,"title":"Allow starting multiline mode in a different place","user":{"login":"rtfeldman","id":1094080,"avatar_url":"https://avatars.githubusercontent.com/u/1094080?v=3","gravatar_id":"","url":"https://api.github.com/users/rtfeldman","html_url":"https://github.com/rtfeldman","followers_url":"https://api.github.com/users/rtfeldman/followers","following_url":"https://api.github.com/users/rtfeldman/following{/other_user}","gists_url":"https://api.github.com/users/rtfeldman/gists{/gist_id}","starred_url":"https://api.github.com/users/rtfeldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtfeldman/subscriptions","organizations_url":"https://api.github.com/users/rtfeldman/orgs","repos_url":"https://api.github.com/users/rtfeldman/repos","events_url":"https://api.github.com/users/rtfeldman/events{/privacy}","received_events_url":"https://api.github.com/users/rtfeldman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/avh4/elm-format/labels/discussion","name":"discussion","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/avh4/elm-format/milestones/1","html_url":"https://github.com/avh4/elm-format/milestones/1.0.0%20public%20stable%20release","labels_url":"https://api.github.com/repos/avh4/elm-format/milestones/1/labels","id":1365483,"number":1,"title":"1.0.0 public stable release","description":"","creator":{"login":"avh4","id":1222,"avatar_url":"https://avatars.githubusercontent.com/u/1222?v=3","gravatar_id":"","url":"https://api.github.com/users/avh4","html_url":"https://github.com/avh4","followers_url":"https://api.github.com/users/avh4/followers","following_url":"https://api.github.com/users/avh4/following{/other_user}","gists_url":"https://api.github.com/users/avh4/gists{/gist_id}","starred_url":"https://api.github.com/users/avh4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avh4/subscriptions","organizations_url":"https://api.github.com/users/avh4/orgs","repos_url":"https://api.github.com/users/avh4/repos","events_url":"https://api.github.com/users/avh4/events{/privacy}","received_events_url":"https://api.github.com/users/avh4/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":23,"state":"open","created_at":"2015-10-20T05:19:39Z","updated_at":"2016-01-19T06:55:57Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-01-19T00:12:50Z","updated_at":"2016-01-19T07:44:50Z","closed_at":null,"body":"Now that I have [elm-check tests in elm-css](https://github.com/rtfeldman/elm-css/blob/master/test/Compile.elm#L73-L89), I have noticed a pattern of wanting to write this:\r\n\r\n```elm\r\n    [ suite \"rgb\"\r\n        [ it \"does not warn when everything is valid\"\r\n            (\\_ -> 0)\r\n            getRgbWarnings\r\n            (tuple3 ( validRgbValue, validRgbValue, validRgbValue ))\r\n\r\n        , it \"warns for invalid r values\"\r\n            (\\_ -> 1)\r\n            getRgbWarnings\r\n            (tuple3 ( invalidRgbValue, validRgbValue, validRgbValue ))\r\n```\r\n\r\n...but instead only being able to come as close as this:\r\n\r\n```elm\r\n    [ (suite \"rgb\")\r\n        [ (it \"does not warn when everything is valid\")\r\n            (\\_ -> 0)\r\n            getRgbWarnings\r\n            (tuple3 ( validRgbValue, validRgbValue, validRgbValue ))\r\n        , (it \"warns for invalid r values\")\r\n            (\\_ -> 1)\r\n            getRgbWarnings\r\n            (tuple3 ( invalidRgbValue, validRgbValue, validRgbValue ))\r\n```\r\n\r\nThe removed blank line would be addressed by https://github.com/avh4/elm-format/issues/97 but the mandatory parentheses would remain.\r\n\r\nelm-css itself [has a similar problem](https://github.com/rtfeldman/elm-css/blob/master/test/CompileFixtures.elm#L32-L64): I want to write this...\r\n\r\n```elm\r\ndreamwriter : Stylesheet\r\ndreamwriter =\r\n  stylesheet\r\n    { name = \"dreamwriter\" }\r\n    [ each [ html, body ]\r\n        [ width (pct 100)\r\n        , height (pct 100)\r\n        ]\r\n\r\n    , (.) Hidden\r\n        [ (display none) |> important ]\r\n\r\n    , (#) Page\r\n        [ width (pct 100)\r\n        , height (pct 100)\r\n        , color pageDefaultText\r\n        ]\r\n    ]\r\n```\r\n\r\n...but instead must write this:\r\n\r\n```elm\r\ndreamwriter : Stylesheet\r\ndreamwriter =\r\n  stylesheet\r\n    { name = \"dreamwriter\" }\r\n    [ (each [ html, body ])\r\n        [ width (pct 100)\r\n        , height (pct 100)\r\n        ]\r\n    , ((.) Hidden)\r\n        [ (display none) |> important ]\r\n    , ((#) Page)\r\n        [ width (pct 100)\r\n        , height (pct 100)\r\n        , color pageDefaultText\r\n        ]\r\n    ]\r\n```\r\n\r\nIt seems like \"all in one line\" or \"break after the function itself\" for function application is too black-and-white for a common DSL use case.\r\n\r\nAllowing the end user to \"break\" (and from then on be in multiline mode) after 0 or more arguments have been passed to the function (instead of always after 0 as it currently stands) would make using DSLs like this much easier.\r\n\r\nFor example:\r\n\r\n```elm\r\n-- currently allowed\r\nfoo\r\n  bar\r\n  baz\r\n  qux\r\n\r\n(foo bar)\r\n  baz\r\n\r\n-- proposed to be additionally allowed as well\r\nfoo bar\r\n  baz\r\n  qux\r\n\r\nfoo bar baz\r\n  qux\r\n```\r\n\r\nI think only allowing one \"break\" per function application chain (after which the remaining arguments are multiline) would be reasonable."},"comment":{"url":"https://api.github.com/repos/avh4/elm-format/issues/comments/172766371","html_url":"https://github.com/avh4/elm-format/issues/115#issuecomment-172766371","issue_url":"https://api.github.com/repos/avh4/elm-format/issues/115","id":172766371,"user":{"login":"avh4","id":1222,"avatar_url":"https://avatars.githubusercontent.com/u/1222?v=3","gravatar_id":"","url":"https://api.github.com/users/avh4","html_url":"https://github.com/avh4","followers_url":"https://api.github.com/users/avh4/followers","following_url":"https://api.github.com/users/avh4/following{/other_user}","gists_url":"https://api.github.com/users/avh4/gists{/gist_id}","starred_url":"https://api.github.com/users/avh4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avh4/subscriptions","organizations_url":"https://api.github.com/users/avh4/orgs","repos_url":"https://api.github.com/users/avh4/repos","events_url":"https://api.github.com/users/avh4/events{/privacy}","received_events_url":"https://api.github.com/users/avh4/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T07:44:50Z","updated_at":"2016-01-19T07:44:50Z","body":"What if the first argument always went on the same line? (assuming the first argument was not a multi-line expression)"}}