Re: [Haskell-cafe] Desugaring of infix operators is (always?) the wrong way round

2007-09-25 Thread Sam Hughes
Brian Hulley wrote: Dan Piponi wrote: On 9/25/07, Brian Hulley [EMAIL PROTECTED] wrote: .. I don't understand what you mean. For example, with the prefix definition of a function with multiple clauses, the function name at the start of each clause is already lined up since it must appear

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-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] How can I stop GHCi from calling show for IO actions?

2007-09-15 Thread Sam Hughes
Ryan Ingram wrote: Prelude let inf = repeat 1 Prelude inf [1,1,(lots of output until I press ctrl-c),Interrupted. (I expect this to happen) Prelude let x = inf (no output here!) Prelude :t x x :: [Integer] Prelude return inf [1,1,(lots of output until I press ctrl-c),Interrupted. (I also expect

Re: [Haskell-cafe] IO within parser

2007-08-13 Thread Sam Hughes
Malte Milatz wrote: Sam Hughes [EMAIL PROTECTED], Sun, 12 Aug 2007 20:12:55 -0400: [A parser like Parsec, with monad transformers:] $ darcs get http://samuelhughes.com/darcs/partran/ Is this related in any way to the following GSoC project? http://code.google.com/soc/2007/haskell

Re: [Haskell-cafe] IO within parser

2007-08-12 Thread Sam Hughes
Malte Milatz wrote: If not using unsafePerformIO, which is usually not what we want, the monad m in question must incorporate IO. That is, it could be defined something like (say we want a parser with state): newtype IOParser tok s a = IOParser (s - [tok] - IO (s,a)) You