[Haskell-cafe] Proposal: Applicative => Monad: Call for consensus

Maciej Piechotka uzytkownik2 at gmail.com
Tue Jan 25 09:19:02 CET 2011


On Mon, 2011-01-24 at 20:13 -0800, Ryan Ingram wrote:
> On Fri, Jan 21, 2011 at 7:58 PM, Casey Hawthorne <caseyh at istar.ca> wrote:
> > uj supplied this:
> >
> > About the discussion
> > "putStrLn (readLn + (5 :: Int))"..
> >
> > I'll write it as the following line,
> >
> > importing Control.Applicative
> > main = (+) readLn (return 3)
> >
> > They look almost exactly same in my eyes..
> 
> You're missing some bits.
> 
> main = print =<< liftM2 (+) readLn (return 3)
> 
> Which I assert looks like more line noise than some perl programs I've read. :)
> 

Or using idiom brackets (for example from SHE):

main = print =<< (| readLn + ~3 |)

or

main = (| print (| readLn + ~3 |) @|)

Regards

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110125/f9dbc096/attachment.pgp>


More information about the Haskell-Cafe mailing list