DoAndIfThenElse

Ian Lynagh igloo at earth.li
Thu Nov 26 09:23:36 EST 2009


On Thu, Nov 26, 2009 at 03:14:13PM +0100, Christian Maeder wrote:
> David Virebayre schrieb:
> > 
> > On Thu, Nov 26, 2009 at 10:29 AM, Christian Maeder
> > <Christian.Maeder at dfki.de <mailto:Christian.Maeder at dfki.de>> wrote:
> > 
> >     I wonder why I still get a "parse error (possibly incorrect
> >     indentation)" for:
> > 
> >     \begin{code}
> >     main = do
> >      if True then putStrLn "1"
> >      else putStrLn "2"
> >     \end{code}
> 
> This works with hugs!
> 
> >  
> > Isn't the proposal about :
> > 
> > \begin{code}
> > main = do
> >  if True then putStrLn "1"
> >  ;else putStrLn "2"
> > \end{code}
> 
> This does not work with hugs. ";" must be indented further.
> 
> \begin{code}
> main = do
>   if True then putStrLn "1";
>   else putStrLn "2"
> \end{code}
> 
> This does also not work with hugs (";" at the end)

In both cases you have 2 semi-colons before the else (after the layout
rule has been applied).


Thanks
Ian



More information about the Haskell-prime mailing list