Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One might say your original claim was not in good faith. You said

> Look at all the monad insanity Haskell has to do to get the equivalent of a print statement

but it's easy to do that! If you meant something more complex and subtle perhaps you should have made a more complex and subtle claim.



yea, it's so easy that's why there's dozens of many-page tutorials on the topic.


You don't need to understand monads to do IO. From [0]:

> There is nothing that has to do with monads at all in printing a string. The idea that `putStrLn "hello world"` is monadic is as absurd as saying that `[1,2,3]` is monadic.

You haven't linked any exemplar tutorials, but I feel confident in saying the ones you're referring to teach the general concept of monads, and not how to do IO with monads.

Quite a number of JavaScript developers learned how to use `andThen` with Promises/A+ back in the day, and they didn't need to learn about monads either. (In fact, when it was raised that promises are really monads, there was serious drama and outrage [1] -- an existence proof if there ever was one, that you can use something productively without understanding it as a monad.)

Likewise, nobody would claim that you need to understand monoids before you can concatenate lists. Concatenating lists is as native to lists as sequencing commands is to IO; it's just part of how those types work. The monad interface abstracts over that idea, and learning that abstraction in its full generality is, typically, what people stumble on.

[0]: https://blog.jle.im/entry/io-monad-considered-harmful.html

[1]: https://github.com/promises-aplus/promises-spec/issues/94


How many articles are there on writing your first program in Python? Is that a result if it being difficult? This is not a valid method of assessment.

Relative to programming in general, monads are easy to work with, easy enough to understand, but I’ll grant you often poorly explained.


Articles on python don’t generally start with “Ignore the thousands of other articles, this one ACTUALLY explains it”


You seem to have made an uninformed opinion where you saw some people struggling to do one thing, and just assumed they were doing something completely different.

Those people writing monad tutorials (those are written about as often as they are read) aren't trying to learn how to do I/O.


I think there was mostly a problem where people refused to stop trying to explain it with confusing burrito analogies. It's not too bad if you read the type definition and maybe read some compiler IL.

(And of course "it's just a monoid in the category of endofunctors".)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: