Re: [Haskell-cafe] Noob question and sequence of operations (print then do something else)

2007-09-24 Thread Sam Hughes
John Wicket wrote: On 9/24/07, Sam Hughes [EMAIL PROTECTED] wrote: John Wicket wrote: I am still in an imperative way of thinking. In this example here; how would I call putStrLn and then set the function with a value. Eg: aa :: String - IO () aa instr = do putStrLn abc putStrLn abc

Re: [Haskell-cafe] Noob question and sequence of operations (print then do something else)

2007-09-24 Thread Andrew Coppin
John Wicket wrote: Sorry, I was actually trying to use this as an example for something more complicated I am trying to do. In this example, why would the inferred type be IO () aa :: String - String aa instr = do putStrLn abc putStrLn abc return Az Couldn't match expected type

Re: [Haskell-cafe] Noob question and sequence of operations (print then do something else)

2007-09-24 Thread Henning Thielemann
On Mon, 24 Sep 2007, John Wicket wrote: I am still in an imperative way of thinking. In this example here; how would I call putStrLn and then set the function with a value. Eg: aa :: String - IO () aa instr = do putStrLn abc putStrLn abc return 123 The article

Re: [Haskell-cafe] Noob question and sequence of operations (print then do something else)

2007-09-24 Thread Lanny Ripple
Well aa isn't returning a string. It's returning a function for later evaluation which encapsulates the string. It's like driving anywhere in California. You can't get there following the road signs unless you've driven there once before. In this case the road signs say return a string but

[Haskell-cafe] Noob question and sequence of operations (print then do something else)

2007-09-23 Thread John Wicket
I am still in an imperative way of thinking. In this example here; how would I call putStrLn and then set the function with a value. Eg: aa :: String - IO () aa instr = do putStrLn abc putStrLn abc return 123 --- The error I am getting. Couldn't match expected type `()' against

Re: [Haskell-cafe] Noob question and sequence of operations (print then do something else)

2007-09-23 Thread Sam Hughes
John Wicket wrote: I am still in an imperative way of thinking. In this example here; how would I call putStrLn and then set the function with a value. Eg: aa :: String - IO () aa instr = do putStrLn abc putStrLn abc return 123 --- The error I am getting. Couldn't match expected

Re: [Haskell-cafe] Noob question and sequence of operations (print then do something else)

2007-09-23 Thread John Wicket
Sorry, I was actually trying to use this as an example for something more complicated I am trying to do. In this example, why would the inferred type be IO () aa :: String - String aa instr = do putStrLn abc putStrLn abc return Az Couldn't match expected type `[t]' against inferred type