http://hackage.haskell.org/trac/haskell-prime/wiki/DoAndIfThenElse says
(and my memory seems to agree) that GHC has been changed to accept
things like

   readnums f n = do eof <- hIsEOF f
                     if eof
                     then return n
                     else do l <- hGetLine f
                             readnums f (n + read l)

where the `then' and `else' are aligned with the `if' rather than being
slightly more indented as the Haskell 98 standard requires.
Yet, when I try it with GHCi 6.8.2 I get an error:

   Prelude> :load "/home/monnier/tmp/foo.hs"
   [1 of 1] Compiling Main      ( /home/monnier/tmp/foo.hs, interpreted )
   
   /home/monnier/tmp/foo.hs:6:18:
       parse error (possibly incorrect indentation)
   Failed, modules loaded: none.
   Prelude> 

Does anybody know what's up with that?


        Stefan

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to