RE: [Haskell-cafe] The essence of my monad confusion

2009-05-27 Thread Paul Keir
Thanks for all the help. The simplified example indeed threw away too much. There were no side effects. Brent, of course I couldn't create your function; though I gained through trying. I then found it useful to consider the type of: fmap (\x -> putStrLn x) getLine which is IO (IO ()) and hence

Re: [Haskell-cafe] The essence of my monad confusion

2009-05-02 Thread Felipe Lessa
On Sat, May 02, 2009 at 05:31:03PM +0100, Paul Keir wrote: > An example immediately follows that quotation on the wiki: > > do text <- getLine >if null text > then putStrLn "You refuse to enter something?" > else putStrLn ("You entered " ++ text) Then, how about getMyLine = getL

Re: [Haskell-cafe] The essence of my monad confusion

2009-05-02 Thread Brent Yorgey
On Sat, May 02, 2009 at 05:31:03PM +0100, Paul Keir wrote: > On the wiki page for Applicative Functors > (http://www.haskell.org/haskellwiki/Applicative_functor) a familiar > characteristic of monads is quoted; that they "allow you to run actions > depending on the outcomes of earlier actions".

Re: [Haskell-cafe] The essence of my monad confusion

2009-05-02 Thread Antoine Latter
On Sat, May 2, 2009 at 11:31 AM, Paul Keir wrote: > On the wiki page for Applicative Functors > (http://www.haskell.org/haskellwiki/Applicative_functor) a familiar > characteristic of monads is quoted; that they "allow you to run actions > depending on the outcomes of earlier actions". I feel comf