id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
2259	can not make `if` look nice in a `do`	jsnx		"The handling of {{{if}}} within a {{{do}}} block is not consistent with it's handling outside of it.

{{{

import Text.ParserCombinators.Parsec

date AesthErr
  = LineTooLong SourcePos Int

 -- works fine
shorty0 len                  =  do
  s                         <-  manyTill anyChar newLine
  case length s > len of
    True                    ->  do
      pos                   <-  getPosition
      return $ Left $ LineTooLong pos len
    _                       ->  return $ Right s

 -- epic fail
shorty1 len                  =  do
  s                         <-  manyTill anyChar newLine
  if length s > len then
    do
      pos                   <-  getPosition
      return $ Left $ LineTooLong pos len
  else
    return $ Right s

 -- epic fail
shorty2 len                  =  do
  s                         <-  manyTill anyChar newLine
  if length s > len then
    fmap (Left . flip LineTooLong len) getPosition
  else
    return $ Right s

}}}

Whereas this is fine:

{{{
f n =
  if n > 7 then
    ""Great!""
  else
    ""Less!""
}}}

Is this something I can fix?"	bug	closed	normal		Compiler (Parser)	6.8.2	invalid			MacOS X	x86		Unknown				
