Just to be clear, I *think* layout rules don't apply here at all, actually.If I understand correctly, "layout" has to do with turning spacing into braces and semicolons. A new line is a semicolon. A brace group is inserted around things that are aligned where a brace group actually makes sense.e.g.let x = yy = zin ...gets turned into roughlylet { x = y; y = z} in ...if-then-else however is just an expression, like a ternary operator, so it doesn't need any semicolons or braces. So layout is unrelated, except for the issue of `do` blocks inserting semicolons into `if-then-else` groups (and that's what DoAndIfThenElse fixes).-- AndrewPS. I am very glad someone is working on ghc-exactprint. It's a really important step in developing better Haskell tooling, imho. Doing that sort of thing right now with haskell-src-exts right now is a real pain (see half of the closed issues on hindent... about how it doesn't preserve formatting in many places.)On Tue, Mar 10, 2015 at 9:25 AM, Alan & Kim Zimmerman <alan.zimm@gmail.com> wrote:_______________________________________________AlanOk, adding a do does make a difference. More complexity.ThanksOn Tue, Mar 10, 2015 at 6:06 PM, Brandon Allbery <allbery.b@gmail.com> wrote:On Tue, Mar 10, 2015 at 12:01 PM, Alan & Kim Zimmerman <alan.zimm@gmail.com> wrote:--I am working on ghc-exactprint, and need to flag points where layout must be preserved, and considering the `if` statement.
My understanding of the layout rules for if then else is that the `then` has to start more to the right than the `if`.I believe you are looking for DoAndIfThenElse.brandon s allbery kf8nh sine nomine associatesunix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe