4 ms·
> They chose a deliberately over-simplified example in order to demonstrate the core concepts; i wish people who are writing guides on these topics pick a non-
by chii 14y ago
> They chose a deliberately over-simplified example in order to demonstrate the core concepts;
i wish people who are writing guides on these topics pick a non-simplified situation where using this method makes for an easier program (vs using the "traditional method"). The comparison and contrasting of a functional/monadic approach vs a procedural approach in a complex scenario might actually shed more light - at least, for some one who is familiar with the procedural approach.
- balloot 14y agoI would love to see this! One of the fundamental issues I have with functional languages is every example I see is basically "See this thing that's relatively simple and uncomplicated in Ruby/PHP/C/whatever? Here's how to do that in Haskell!" And the Haskell version ends up being extremely unintuitive and complicated. Bottom line is I still don't know for which situations functional languages are a "good" tool.
- gizmo686 14y agoI think the problem is that the Haskell version is actually very simple, to the person writing it. Its a classical problem of teaching, it is extremly easy to forget how something looks to new people.
- egonschiele 14y agoAgain, if you tell me where you're stumbling, I can fix it. I see your complaints all over this post and you haven't responded to me once.
- nandemo 14y agoThat approach is used at length in Real World Haskell. For example, some code for key-value lookup is shown that deals with a series of Maybe foo values, first with a cascade of guards (think a cascade of if-else's), and later with monad syntax. There are other examples. http://book.realworldhaskell.org/read/programming-with-monads.html http://book.realworldhaskell.org/read/programming-with-monad...
- lobster_johnson 14y agoI enjoyed RWH much more after having learned a lot of the basics. It starts off simple, to be sure, but then quickly jumps into the deep end. For a book that's about real-world stuff it gets into a lot of unnecessary detail, too, that should have been deferred until later "advanced" chapters. I appreciated the hands-on approach to real examples, though. "Learn You A Haskell For Great Good" [1], while much less complete, is the best intro I have found so far. It's also free. [1] http://learnyouahaskell.com/ http://learnyouahaskell.com/