[Haskell-cafe] State Monad

2004-03-03 Thread Georg Martius
Hi folks, I have a question to the State Monad or Monads in general - I'am not sure. Lets assume I have functions to transform strings. I can use the State Monad as follows: strTrans :: String - String strTrans s = s ++ s f :: State String () f = do put hallo modify strTrans

Re: [Haskell-cafe] State Monad

2004-03-03 Thread Wolfgang Jeltsch
Am Mittwoch, 3. Mrz 2004 14:44 schrieb Georg Martius: [...] Now I have also functions to map from (a, String) - (a,String). I could write: modifyT :: ((a, String) - (a, String)) - a - State String a modifyT trans a = do str - get let (a', str') = trans (a, str)

Re: [Haskell-cafe] State Monad

2004-03-03 Thread Iavor S. Diatchki
hi, Georg Martius wrote: Now I have also functions to map from (a, String) - (a,String). I could write: modifyT :: ((a, String) - (a, String)) - a - State String a modifyT trans a = do str - get let (a', str') = trans (a, str) put str' return a' f ::

Re: [Haskell-cafe] State Monad

2004-03-03 Thread Wolfgang Jeltsch
Am Mittwoch, 3. Mrz 2004 18:15 schrieb Georg Martius: Thanks for your answer. I got it now. It works with lift instead of liftM. Yes, of course. Georg Wolfgang ___ Haskell-Cafe mailing list [EMAIL PROTECTED]

Re: [Haskell-cafe] State Monad

2004-03-03 Thread Tom Pledger
Georg Martius wrote: [...] I could write: modifyT :: ((a, String) - (a, String)) - a - State String a modifyT trans a = do str - get let (a', str') = trans (a, str) put str' return a' f :: State String () f = do put hallo modify strTrans i -

[Haskell-cafe] a rant from a stoned suicidal person

2004-03-03 Thread Chris Moline
i want to start off by apologizing. im lonely. i dont know anyone. anyone at all who is liek me. im different. everyone else is content to just watch tv all the time and then on weekends go and get drunk. im not. i am not threatening anything here when i say waht i am about to say. i know that

Re: [Haskell-cafe] a rant from a stoned suicidal person

2004-03-03 Thread Tom Pledger
There are a lot of hoaxes on the internet, but just in case you're for real, here's an idea... Step 1: Take 20 minutes to get some fresh air. Step 2: When you get back to your computer, take 5 minutes to read Desiderata (http://shell.world-net.co.nz/~unikorn/desiderata.htm), especially the