News for hackers. Stuff that matters.
Re:Once you go functional, you can never go back by codygman on Monday May 18, 2015 @12:40PM (#9565376)
> each time you actually want to do something (change the state of the world), you are severely beaten with a shower of monads that make side effects hell, even if the specific side effect you need is as trivial (and innocuous) as they come.

    readFile "/etc/issue" >>= putStrLn
Man, I feel so beaten.
Re:Once you go functional, you can never go back by tempodox on Tuesday May 19, 2015 @10:43AM (#9570379)
Ha, just put this code into any old deeply nested function that's not already contaminated with the IO monad. Or try to do something that needs two monads at the same time.
Re:Once you go functional, you can never go back by codygman on Wednesday May 20, 2015 @03:38AM (#9574945)
> Ha, just put this code into any old deeply nested function that's not already contaminated with the IO monad.

Why would I want to do that? I could just pass the filepath to that function if it needed it, or if I want it to log messages I could use the writer monad.

> Or try to do something that needs two monads at the same time.

Monad transfomers aren't so hard: http://www.cs.virginia.edu/~wh5a/personal/Transformers.pdf

Edit: One of my favorite papers, I believe multiple monads are used in it: http://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/ba...