7 ms·
I've been looking at learning Haskell for al the obvious reasons, but I've been put off by all the lengthy and detailed introductions to the syntax, and math o
by raarts 12y ago
I've been looking at learning Haskell for al the obvious reasons, but I've been put off by all the lengthy and detailed introductions to the syntax, and math oriented examples, that seem written by theoreticists.
What I would like (and in my opinion what Haskell needs to grow), is a more practical introduction, like doing a database conversion, or writing some network service. Syntax can be explained in passing. Does this exist?
- dllthomas 12y agoTry the WikiBook (http://en.wikibooks.org/wiki/Haskell http://en.wikibooks.org/wiki/Haskell). And if it doesn't present something well, fix it!
- rybosome 12y agoI was pretty impressed with the content in "Real World Haskell"[0], it's available online for free and for sale in print. I don't remember all of the practical examples, but off the top of my head, they include wiring up a pcre library by using FFI into C and reading a barcode from an image. This talk claims that the book is out of date; that's probably true, but I still found it to be valuable. [0] http://book.realworldhaskell.org http://book.realworldhaskell.org
- jsmeaton 12y agoI've just started with Learn You A Haskell [0] and I'm really enjoying it (and learning). It does focus a lot on the syntax and types at the beginning though - but I've found that a nice way to learn so far. [0] http://learnyouahaskell.com/ http://learnyouahaskell.com/
- zeckalpha 12y agoWhat syntax? Haskell has just about the simplest syntax.
- gizmo686 12y agoBut it has some obscure function names that look alot like syntax. (eg. "$", ".", ">>=" etc)
- jeorgun 12y agoI think that's raart's point. The syntax is really simple and easy to pick up, so all the tutorials focusing mainly on syntax and paying less attention to actually, well, getting things done, do the language a disservice.
- johan_larson 12y agoIn nearly every mainstream programming language, you call a function like this: f(a, b, c) But not in Haskell, where you do it like this: f a b c Of course, there is a reason for doing things this way in Haskell, namely making currying a natural part of the language. If f is a function of three variables, f a b binds values to the first two parameters, yielding a function of one variable. But it's still a change and a bit of a hurdle.
- gtani 12y agothere's lots of books, and a couple recent ones, listed here, depending on what you're looking for: http://www.reddit.com/r/haskell/comments/2cpr4z/recommended_reading_material/ http://www.reddit.com/r/haskell/comments/2cpr4z/recommended_... and FP complete have put a huge effort into putting up tutorials that you can run through interactively https://www.fpcomplete.com/ https://www.fpcomplete.com/
- kasbah 12y agoIts not databases or network services but Write Yourself a Scheme in 48Hrs [1] is a more practical intro. Aside from that I would recommend the cis194 Lectures [2] if you do feel ready to take a slightly more thorough top down approach. There are exercises for every almost every lecture and you can even peak at your digital neighbours to compare solutions [3]. [1]: https://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours https://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_... [2]: http://www.seas.upenn.edu/~cis194/lectures.html http://www.seas.upenn.edu/~cis194/lectures.html [3]: https://github.com/search?q=cis194&type=Everything&repo=&langOverride=&start_value=1 https://github.com/search?q=cis194&type=Everything&repo=&lan...
- djur 12y agoThis is kind of the problem, though: Haskell is popular among people for whom "write Scheme in this language" is an example of a practical introduction. It frequently seems like a community of PLT experts talking with PLT apprentices, with the workaday concerns of 95% of practicing developers treated as an exercise to figure out on your own time. This isn't a criticism of Haskell or Haskellers. It's more an observation that the current makeup of the Haskell community might prove to be a drag on its appeal.
- kasbah 12y agoI guess so. I got a bit fed up with parsing text too and got side-tracked to more graphical things. Initially to Elm [1]. It's not exactly Haskell but Elm is a fun way to get into Functional and Functional Reactive programming while drawing some things on screen and making them move. There are probably more graphical tutorials for Haskell too. I recently found some good examples for Gloss [2] and am moving from Elm to that right now. There is an "Elm for Haskell" called HElm [3] too. [1]: http://elm-lang.org http://elm-lang.org [2]: http://gloss.ouroborus.net http://gloss.ouroborus.net [3]: http://helm-engine.org http://helm-engine.org
- coolsunglasses 12y agoI teach a lot of Haskell [1] and observe a lot of people teaching Haskell. Write Yourself a Scheme is not representative of how the Haskell community teaches Haskell. I can't even remember the last time it was cold-suggested to somebody. The last person I knew to do so, did so knowing they were going about it the "hard way". They also did it with the intent of actively upgrading/updating the code WYASI48H as they went into a more modern style. They gave a talk on it after. It's a good way to firm up your knowledge if it's the sort of project that interests you, but needs love and isn't a good introduction for most. [1]: https://github.com/bitemyapp/learnhaskell https://github.com/bitemyapp/learnhaskell
- kndyry 12y agoThis was me as well. I had tried several resources and books (including LYAH) and while I had enjoyed them, they hadn't seemed to "stick." I can't recall now where I saw Conrad Barski's tutorial [0] mentioned, perhaps here on HN, but I found his approach much more personally suitable. He steps the reader through writing a program that reads in and then divides an arbitrary park map into small, roughly equivalent picnic plots with colored SVG output along the way. The code takes center stage and is presented to the reader with the why and a good/bad analysis afterward. I'm not sure whether this is what you're after, but at the very least it's worth a glance. [0] http://lisperati.com/haskell/ http://lisperati.com/haskell/
- collyw 12y agoI'd like to see some practical software written in Haskell (probably database based like you suggest). It sounds great theoretically, but I haven never come across Haskell in the wild.
- codygman 12y agoWhat about html parsing/posting, api creation/consumption, and screen scraping? It's what I've used Haskell for the most and would be happy to make some introductory tutorials.
- Bootvis 12y agoI believe those could be very valuable. It's practical and doesn't have to be too complex and touches a number interesting topics.
- djur 12y agoYes, please. There's a dearth of this kind of material.
- codygman 12y agoAlright, I'll respond to you here again when I've wrote something.
- codygman 12y agoI didn't write it, but I came across something that might be of interest to you: http://pbrisbin.com/posts/writing_json_apis_with_yesod/ http://pbrisbin.com/posts/writing_json_apis_with_yesod/
- Bootvis 12y agoWow, thanks for the follow-up! I will have to check it out later. Thanks again.
- mattgreenrocks 12y agoI agree with you here. But I've found it semi-refreshing to be confronted with something that is different enough that I have to sit down with it regularly to practice. It isn't just another language, and it really isn't amenable to just fiddling with things until they work. That said, the gap from newbie to competent is big, an I feel like this is mostly a documentation issue. I've only started very recently and I have awhile to go. You can't expect to grok the implications of monads, laziness, immutability, and pure functional style immediately. But hat doesn't mean they aren't worthwhile, or interesting. Now if you'll excuse me, I need to harass, er, ask for help on some Haskell I'm stuck on. (BTW: the community is really helpful. There are no charlatans or self-promotional jerks like you'll find elsewhere.)