[Haskell-cafe] Problems with do notation

2007-11-22 Thread Peter Verswyvelen
worksFine = if True then putStrLn True else putStrLn False worksNOT = do if True then putStrLn True else putStrLn False worksAgain = do if True then putStrLn True else putStrLn False Of course the worksFine function returns an IO action, so has different behavior, but I mean the

Re: [Haskell-cafe] Problems with do notation

2007-11-22 Thread Thomas Schilling
On Thu, 2007-11-22 at 09:19 +0100, Peter Verswyvelen wrote: worksFine = if True then putStrLn True else putStrLn False worksNOT = do if True then putStrLn True else putStrLn False worksAgain = do if True then putStrLn True else putStrLn False Of course the

Re: [Haskell-cafe] Problems with do notation

2007-11-22 Thread Luke Palmer
On Nov 22, 2007 8:19 AM, Peter Verswyvelen [EMAIL PROTECTED] wrote: worksFine = if True then putStrLn True else putStrLn False This is just an expression, the indentation is inconsequential. worksNOT = do if True then putStrLn True else putStrLn False The first line,

Re: [Haskell-cafe] Problems with do notation

2007-11-22 Thread Henning Thielemann
On Thu, 22 Nov 2007, Peter Verswyvelen wrote: worksFine = if True then putStrLn True else putStrLn False worksNOT = do if True then putStrLn True else putStrLn False worksAgain = do if True then putStrLn True else putStrLn False Of course the worksFine

Re: [Haskell-cafe] Problems with do notation

2007-11-22 Thread Bulat Ziganshin
Hello Peter, Thursday, November 22, 2007, 11:19:20 AM, you wrote: Of course the worksFine function returns an IO action, so has different behavior, but I mean the indentation is different. Is this by design? to be exact, Haskell procedure is just a function returning an action. i recommend