{"action":"created","issue":{"url":"https://api.github.com/repos/purescript/purescript/issues/2051","repository_url":"https://api.github.com/repos/purescript/purescript","labels_url":"https://api.github.com/repos/purescript/purescript/issues/2051/labels{/name}","comments_url":"https://api.github.com/repos/purescript/purescript/issues/2051/comments","events_url":"https://api.github.com/repos/purescript/purescript/issues/2051/events","html_url":"https://github.com/purescript/purescript/issues/2051","id":150623248,"number":2051,"title":"Change indentation after keywords","user":{"login":"AppShipIt","id":48431,"avatar_url":"https://avatars.githubusercontent.com/u/48431?v=3","gravatar_id":"","url":"https://api.github.com/users/AppShipIt","html_url":"https://github.com/AppShipIt","followers_url":"https://api.github.com/users/AppShipIt/followers","following_url":"https://api.github.com/users/AppShipIt/following{/other_user}","gists_url":"https://api.github.com/users/AppShipIt/gists{/gist_id}","starred_url":"https://api.github.com/users/AppShipIt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppShipIt/subscriptions","organizations_url":"https://api.github.com/users/AppShipIt/orgs","repos_url":"https://api.github.com/users/AppShipIt/repos","events_url":"https://api.github.com/users/AppShipIt/events{/privacy}","received_events_url":"https://api.github.com/users/AppShipIt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/purescript/purescript/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/purescript/purescript/labels/syntax","name":"syntax","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/purescript/purescript/milestones/10","html_url":"https://github.com/purescript/purescript/milestones/0.9.0","labels_url":"https://api.github.com/repos/purescript/purescript/milestones/10/labels","id":858709,"number":10,"title":"0.9.0","description":"","creator":{"login":"paf31","id":630306,"avatar_url":"https://avatars.githubusercontent.com/u/630306?v=3","gravatar_id":"","url":"https://api.github.com/users/paf31","html_url":"https://github.com/paf31","followers_url":"https://api.github.com/users/paf31/followers","following_url":"https://api.github.com/users/paf31/following{/other_user}","gists_url":"https://api.github.com/users/paf31/gists{/gist_id}","starred_url":"https://api.github.com/users/paf31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paf31/subscriptions","organizations_url":"https://api.github.com/users/paf31/orgs","repos_url":"https://api.github.com/users/paf31/repos","events_url":"https://api.github.com/users/paf31/events{/privacy}","received_events_url":"https://api.github.com/users/paf31/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":42,"state":"open","created_at":"2014-11-08T21:18:46Z","updated_at":"2016-05-01T21:43:08Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2016-04-24T04:09:14Z","updated_at":"2016-05-01T21:45:14Z","closed_at":null,"body":"##### I'm brand new to Parsec parlance. I'll revise as I spend more time in the implementation understanding the current behavior. I should consider expressions without reserved words and possible danger of <q>pythonic</q> rules.\r\n\r\nThe reference point for indentation currently allows formatting a user should never write. Example:\r\n\r\n```purs\r\nmain =\r\n        case\r\n      unit\r\n    of\r\n  _ -> \r\nlog \"Hi\"\r\n```\r\n\r\nI propose changing the parser:\r\n\r\n1. Mark the reference point for indentation at each reserved word.\r\n2. Subsequent reserved words in a construction (`case`/`of`, `let`/`in`, `if`/`then`/`else`, etc.) should be at least as indented as the previous.\r\n3. Subexpressions (the thing matched by `case`, `let` bindings, etc.) should be indented beyond their respective reserved word.\r\n\r\nSyntactically valid ways to format the counterexample:\r\n\r\n```purs\r\nmain = case unit of\r\n  _ -> log \"Hi\"\r\n```\r\n\r\n```purs\r\nmain = case\r\n         unit\r\n       of\r\n         _ ->\r\n           log \"Hi\"\r\n```\r\n\r\n```purs\r\nmain =\r\n  case unit\r\n    of\r\n      _ -> log \"Hi\"\r\n```"},"comment":{"url":"https://api.github.com/repos/purescript/purescript/issues/comments/216074798","html_url":"https://github.com/purescript/purescript/issues/2051#issuecomment-216074798","issue_url":"https://api.github.com/repos/purescript/purescript/issues/2051","id":216074798,"user":{"login":"paf31","id":630306,"avatar_url":"https://avatars.githubusercontent.com/u/630306?v=3","gravatar_id":"","url":"https://api.github.com/users/paf31","html_url":"https://github.com/paf31","followers_url":"https://api.github.com/users/paf31/followers","following_url":"https://api.github.com/users/paf31/following{/other_user}","gists_url":"https://api.github.com/users/paf31/gists{/gist_id}","starred_url":"https://api.github.com/users/paf31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paf31/subscriptions","organizations_url":"https://api.github.com/users/paf31/orgs","repos_url":"https://api.github.com/users/paf31/repos","events_url":"https://api.github.com/users/paf31/events{/privacy}","received_events_url":"https://api.github.com/users/paf31/received_events","type":"User","site_admin":false},"created_at":"2016-05-01T21:45:14Z","updated_at":"2016-05-01T21:45:14Z","body":"`do` is a bit of a special case here, since we probably want to keep the ability to put statements on a new line after `do`:\r\n\r\n```purescript\r\nmyAction = do\r\n  something\r\n  somethingElse\r\n```\r\n\r\nActually, one could make the same case for the new lambda-case like syntax:\r\n\r\n```purescript\r\nlefts = mapMaybe $ case _ of\r\n  Left a -> Just a\r\n  _ -> Nothing\r\n```"}}