[Haskell-cafe] Layout rules for if then else

Alan & Kim Zimmerman alan.zimm at gmail.com
Tue Mar 10 16:01:05 UTC 2015


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`.

Using GHC 7.10 RC2, ghci cheerfully loads the following

```
f =
    if True
 then 1
  else 2

```

Is this valid? Have the rules been relaxed?

Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150310/05001b1e/attachment.html>


More information about the Haskell-Cafe mailing list