5 ms·
Also does not tackle monads.
by adharmad 17y ago
Also does not tackle monads.
- maxtilford 17y agoI don't believe tutorials are the right way to figure out monads. For one thing, they aren't as extremely important as they're made out to be, people have just latched on to the name. If you really want to understand monads you have to actually try to write code using them, and struggle through it.
- barrkel 17y agoI understand monads just fine. I would like to see a readable explanation of the exact syntactic transformation of the 'do' notation to the actual function that the monad is to logically return the wrapped application of.
- maxtilford 17y agoIf I'm reading that right, you want to see how do-notation is desugared? The best explanation I could find was http://metafoo.co.uk/practical-monads.txt http://metafoo.co.uk/practical-monads.txt The two sections "Binding lines together" and "Lines that don't return values" explain it nicely.
- PoisonInkwell 17y agoDeliberately. Please note the links to two existing (and very good) monad tutorials... The last thing the Haskell community needs is another lackluster one.
- johnwatson11218 17y agoI had one semester of Haskell in school and thought I knew a thing or two about it. The last thing I attempted in Haskell was the game of blackjack. The two big problems there were user input, and the random numbers that were used to shuffle the deck of cards. Very quickly I had to combine two monads in my code to get anything going and I found it very confusing. It seemed like my entire program had become tainted with the non functional aspects. The tutorials didn't really clear things up either, I'm trying Scala now and that at least seems like it will let me pull in the functional pieces where I can use them.
- jrockway 17y agoMonads are nothing special. "They" somehow acquired some stigma of being "difficult", which caused people to write tutorials to help others understand them. Then the proliferation of tutorials led people to believe that they are difficult to understand, which caused people to write more tutorials. And here we are today, where people avoid a programming language because they think there is some incredibly hard concept they have to master but will never be smart enough to understand. Anyway, the Typeclassopedia is recommended reading: http://www.haskell.org/haskellwiki/Typeclassopedia http://www.haskell.org/haskellwiki/Typeclassopedia Once you understand the relationship between functions, applicative functors, monads, and arrows, everything will make sense -- they are all the same thing. (The next issue is, "why would I want this kind of abstraction", but that's best for you to decide on your own.)