11 ms·
Show HN: Learn Functional Programming Using Haskell
- boothead 10y agoThe presentation is really impressive! I'd be interested to know how much time/resources went into this if Levi is on here?
- xwowsersx 10y agoI know it may not seem like much yet, but I've probably spent 15 hours or so preparing the intro. Previous iterations were much longer so I condensed it considerably to keep a good pace. I sent previous drafts to dozens of people and incorporated feedback from everyone.
- dpflan 10y agoAwesome, thanks for sharing! Here are some other resources to learn Haskell: 1. Learn You a Haskell for Great Good - http://learnyouahaskell.com/ http://learnyouahaskell.com/ - can read the text for free online 2. UVa Student Taught Haskell Course - http://shuklan.com/haskell/ http://shuklan.com/haskell/ 3. Learning Haskell - http://learn.hfm.io/ http://learn.hfm.io/ 4. Haskell Programming - http://haskellbook.com/ http://haskellbook.com/ A question for the author - did you review the other learning materials (i.e. competition or maybe complement(s)) and find discrepancies that made you want to create a better learning resource or were you primarily motivated by how awesome of an experience you had learning Haskell and the desire to share that with others?
- Zuikaku 10y agoHaskell was the first language taught to us in my university course. Literally within the first week. Everybody was new to it. Our lecturer highly recommended Learn You A Haskell on the first day, and it's still one of the best docs/guides I've read in a while.
- xwowsersx 10y agoYeah, I’ve read/reviewed most of them. I could give long opinions on each, but overall I would say that I wanted an easy way to get into the language by building instead of endlessly going over all of the intricacies of the language. There is a time for that, but I’d argue it’s after you get in, get the basics, and start playing. I almost called this a “crash course in Haskell” but I didn’t like what “crash” connotes. I just really want to get people into the practicalities of what’s important as quickly as possible.
- cies 10y agoWhile I really like the course from what I see, I also think that Haskell is not a good subject for a "crash course". In the Learn Haskell From First Principles book[1] it is given why a "crash course" Haskell is not working for many, and I second it. Non the less, the more options the better. And of course I do not know how you do your course. Naturally I wish you best of luck: that your students may succeed in mastering the subject :) [1] http://haskellbook.com http://haskellbook.com
- xwowsersx 10y agoI agree, and that's why we didn't go with "crash course." There's a certain amount of stuff you simply have to work through and know in order to use Haskell, for sure. This course isn't mutually exclusive to something like Haskell Book. The intention is to provide a comprehensive overview so you can quickly get up to speed, have a sense for what real world programming in Haskell looks like and gain a familiarity with the basic concepts that are used over and over. If, after that, you're motivated to go through a 1000 page book, that will serve you well.
- posterboy 10y ago>the more options the better Not true, with infinite options there are infinite bad options.
- hellofunk 10y agoAnd also infinite good options.
- 0xmohit 10y agoA partial list of interesting talks on Haskell are available at https://github.com/0xmohit/talks https://github.com/0xmohit/talks
- nachtigall 10y agoNice. For "No tracking" I also like Shariff (https://github.com/heiseonline/shariff https://github.com/heiseonline/shariff) because it includes the share numbers without comprimising the user's privacy. It does so by crawling these number from the server instead of the user's browser.
- nwalter08 10y agoI wonder if topics learned would apply to Swift. Any ideas?
- hellofunk 10y agoOnly to a limited degree. Swift is not a functional language, though it has some things that are sorta functional. The Haskell paradigm does not translate to an eager, non-GC language like Swift easily.
- LeanderK 10y agoI really, really like video tutorials. I always have problems learning completely new languages because i can't motivate myself to complete the introductionary books. I want to start building things from day one, which is only possible when i am familiar with similar languages. With video-tutorials, i can watch them in the evening because the mental burden is not that great. I know i will miss things, but i watch them rather quick so i can start hacking after a few days (or 2 weeks max). I normally hit the limits of what i can do quickly, because i did not go through a whole book and completed exercise after exercise, but this is no problem, because i have a basic understanding of various parts and can revisit the appropriate videos or google a bit. I am happy this looks like some decent videos will finally produced for haskell
- douche 10y agoI, on the other hand, cannot stand video tutorials. I can read a lot faster than I can watch, and I retain information approximately 1000x better that way. Video players that are difficult to pause precisely and progress frame-by-frame to catch points of interest don't make it any better, nor does the lack of indexing and search-ability for voice/video versus text. But variety is good, different strokes for different folks.
- xwowsersx 10y agoI like videos, but if they don’t have good controls or a transcript I go insane. We’ll be including a transcript (modified so you could read it) with each video as well
- happyslobro 10y agoAwesome. You know what would be really nice to have? Little markers at the beginning of points or concepts, like the numbers in the Bible. If I could bookmark those, and link to them from a digital notebook (are there any good Haskell notebooks?), that would make it very easy to come back to difficult concepts later, or to provide context with my own notes.
- 10y ago
- dmix 10y agoOne benefit of learning Haskell if you're a JS developer is that you'll understand how awesome Purescript is and will already know how to use it: http://www.purescript.org/ http://www.purescript.org/ It was for me at least. As a front-end dev I'm not always able to use Haskell day-to-day but I've found ways to use Purescript.
- wry_discontent 10y agoHow would you say Purescript compares to something like Elm?
- nilkn 10y agoAs a very superficial comparison, PureScript is a lot more similar to Haskell than to Elm. All three are great languages, but of the three Elm is definitely the simplest and IMHO most beginner-friendly. It's also the least flexible and general. In many ways, PureScript is actually a better version of Haskell (e.g., with extensible records). But it's currently very focused on front-end development, and it's missing amazing Haskell features like STM. So outside of front-end stuff it's not nearly as practical to use as Haskell.
- dmix 10y agoThe Elm wikipedia page has a good example of it's limitations compared to PureScript/Haskell: > Unlike Haskell, Elm has no support for higher-kinded types, and thus cannot provide generic abstractions for many common operations.[20] For example, there is no generic map, apply, fold, or filter function. Instead, such names are used prefixed by their module, such as List.map and Dict.map. [1] And from the above source link: > You can't define higher-kinded things like Functor/Applicative/Monad/Foldable and do dictionary-passing style for ad-hoc polymorphism in Elm. [2] But personally, I haven't tried Elm yet so I can't comment. I'm not sure I want to invest in learning a whole new language/framework just to do front-end work. By learning PureScript I can transfer the same knowledge/experience coding in that language to the backend when using Haskell. Much like Clojurescript and a lesser extent Node.js. While Elm is limited to front-end use. [1] https://en.wikipedia.org/wiki/Elm_(programming_language)#Limitations https://en.wikipedia.org/wiki/Elm_(programming_language)#Lim... [2] https://github.com/elm-lang/elm-compiler/issues/396 https://github.com/elm-lang/elm-compiler/issues/396
- weatherlight 10y agoHow well would this transfer to something like Elixir?
- spuz 10y agoPretty well. DailyDrip already do Elixir tutorials: https://www.dailydrip.com/topics/elixir https://www.dailydrip.com/topics/elixir
- unsignedqword 10y agoI almost thought this was some sort of new series from Brian Will, another guy who makes programming video lessons. Your voice sounds quite similar to his: https://www.youtube.com/user/briantwill/videos https://www.youtube.com/user/briantwill/videos
- lindbergh 10y agoWorth noting, Université Paris Diderot will launch its second edition of ocaml programming mooc in september: https://www.fun-mooc.fr/courses/parisdiderot/56002S02/session02/about https://www.fun-mooc.fr/courses/parisdiderot/56002S02/sessio.... I followed along its first edition last year and it was very good. Sure, the instructors had a really thick french accent and the videos had some outdated sound effects and animations, but the concept were well presented. That said, the selling point of this mooc was the high quality of the exercises, which were rather hard, but quite rewarding and very well thought out. By week 2 or 3 you had to implement complex algorithms and functions, eg. a database class or heap's algorithm. Highly recommended.
- nnq 10y agoI still don't quite get it though... Is being impractical actually a virtue for a strictly typed functional language nowadays? Like "if it hurts more, you'll learn more" or something? Why would you drive a beginner towards Haskell and make some many "Haskell for beginners tutorials" instead of OCaml or F# (even Scala fi you're into JVM...) which gives you the same features but slightly more practical (usable records, ability to be impure and imperative when you want etc., some kind of oop-style feature for when they really fit the way you want to model a problem, less "string madness", no "forced verbose" syntax with repeating names of things to type them etc.). Plus friendly new cool tools/skins for them: https://facebook.github.io/reason/ https://facebook.github.io/reason/ , https://github.com/bloomberg/bucklescript https://github.com/bloomberg/bucklescript etc. I agree it seems true, I did learn a lot while struggling to learn Haskell for a bit and hurting in the process, but... why?
- xwowsersx 10y agoBecause the goal of the course is to teach PURELY functional programming (watch the first video for a full definition of that) and Haskell is the most practical language in which to do pure FP AFAIK.
- nnq 10y agook, thanks. if this is your goal, then it seems like the right tool. monadic syntactic sugar helps too, so... ir fits.
- wyager 10y ago> which gives you the same features No they do not. Haskell's powerful typeclass system, advanced (kind) polymorphism, etc. are not available in those languages. Ocaml doesn't even support proper monads. Laughably, it doesn't even support HKTs! Not sure how Scala and F# fare in that regard. >usable records, A reasonable complaint about the core language, but essentially solved by lenses. >ability to be impure and imperative when you want Haskell has the ability to be pure and imperative when you want. You just can't lie about what you're doing. > some kind of oop-style feature Which features? >string madness I never understood this complaint. Three string types, plus lazy variants, is quite manageable. They are all very well-suited for a particular set of tasks, and I'm thankful the Haskell community doesn't shoehorn too much stuff into a single string type. Haskell cleanly solves the encoding problem, which many languages kind of sweep under the rug. > no "forced verbose" syntax with repeating names of things to type them No idea what in the world you are talking about. FWIW, Haskell is by far the least verbose language I have ever used. Every token has semantic significance. No waste.
- akhilcacharya 10y agoMy biggest problem with pure FP languages is a lack of interesting projects - anyone have a good one that isn't a parser?
- hellofunk 10y agoYou can do any kind of project with Haskell; I suspect you aren't looking very hard. Here are some interesting starting points: https://wiki.haskell.org/Game_Development#Videos https://wiki.haskell.org/Game_Development#Videos
- 0xmohit 10y agoHere are some: https://github.com/facebook/Haxl https://github.com/facebook/Haxl - A Haskell library that simplifies access to remote data, such as databases or web-based services. https://github.com/koalaman/shellcheck https://github.com/koalaman/shellcheck - ShellCheck, a static analysis tool for shell scripts https://github.com/simonmichael/hledger https://github.com/simonmichael/hledger - The hledger command-line and web-based accounting tool, a Haskell rewrite of ledger. https://github.com/facebook/flow https://github.com/facebook/flow - Adds static typing to JavaScript to improve developer productivity and code quality. https://github.com/coq/coq https://github.com/coq/coq - Coq is a formal proof management system. It provides a formal language to write mathematical definitions, executable algorithms and theorems together with an environment for semi-interactive development of machine-checked proofs.
- deleted 10y ago[deleted]
- protomikron 10y agoCoq is a theorem prover and library that is written in ML (OCaml), so it is definitely not Haskell. It is interesting that most (interactive) proof systems (e.g. Isabelle and Coq) are written in ML, I think it is probably historical. AFAIK most theorem proving research is done in Europe and ML has always been more popular there (however it seems to change in recent years, and FP courses switch to Haskell - however my school e.g. switched from OCaml to Haskell to OCaml in their FP course).
- nstj 10y agoIf you're looking to learn Haskell on macOS you should really check out "Haskell for Mac" [0]. It's a great native Haskell programming environment not dissimilar to Swift Playgrounds (and there are great video tutorials too). The creator is a great teacher and member of the developer community to boot. [0]: http://haskellformac.com/ http://haskellformac.com/
- hellofunk 10y agoI'm trying to find the video tutorials you mention, where are they?
- nstj 10y agohttp://learn.hfm.io/ http://learn.hfm.io/
- bogomipz 10y agoOh this is awesome. I'm surprised this hasn't gotten more attention. Thanks for sharing!
- sndean 10y agoWondering why this was downvoted? Is Haskell for Mac no good?
- tikhonj 10y agoNo clue. Haskell for Mac is pretty solid—although keep in mind that it's proprietary.
- z1mm32m4n 10y agoComing from an SML background, one of the things that's always tripped me up about Haskell is that it doesn't have structures, signatures, and functors for grouping code. Instead it has modules, which are not much more than groups of exported functions. For Haskellers coming to SML, there's "A Crash Course on ML Modules"[1] which does a nice job of explaining things in the opposite direction. Are there any resources like this out there that discuss how best to break down and write modular Haskell programs? [1]: http://jozefg.bitbucket.org/posts/2015-01-08-modules.html http://jozefg.bitbucket.org/posts/2015-01-08-modules.html (update: I realized the original article I linked to wasn't the one I thought it was!)
- T-R 10y agoThanks for the link. I'm actually under the impression that the situation in Haskell will be changing in the near future with the project called "Backpack"[1][2], which Simon Peyton Jones and Simon Marlow are both involved with. [1] http://plv.mpi-sws.org/backpack/ http://plv.mpi-sws.org/backpack/ [2] https://ghc.haskell.org/trac/ghc/wiki/Backpack https://ghc.haskell.org/trac/ghc/wiki/Backpack
- z1mm32m4n 10y agoOh cool! It looks like the first link is from 2014. Do they discuss their progress somewhere online? I'd love to see what they've done recently.
- sclv 10y agoThis is an interesting question. As much more of a Haskeller than an MLer I don't tend to feel the "need" to structure my programs explicitly modularly, and when I do I sort of instinctively use a combination of typeclasses and polymorphic higher-order functions to do so. More basically, just think "everywhere I would open a module, instead I can take a parameterized record of functions" (and furthermore, if a datatype uniquely determines that record, I can associate a typeclass to that datatype). There are limitations to this, but in fewer circumstances than you'd think -- mainly about sort of cross-modularity (aka the expression problem). There was a very nice discussion on lennart's blog about this in 2008, with a problem posed and some partial solutions (read bottom post to top): http://augustss.blogspot.com/2008_12_01_archive.html http://augustss.blogspot.com/2008_12_01_archive.html
- bogomipz 10y agoA little feedback for the author - The curriculum link is not really a curriculum at all its a preview video. I would be far more inclined to pay $50 if I could see a syllabus, outline or at least the subjects of all the videos in the series. Congrats on releasing your course though.
- pklausler 10y agoHaskell is such a distinct mix of features that make it great to use once you know them but somewhat difficult to learn from scratch. One big fat clue that I wish I had been given when I was starting to try to figure it out on my own back in the 90's is that Haskell is kind of loaded up with syntactic sugar, beneath which is a relatively small core language that might be an easier point of entry into the language. To be specific: infix operators, sections, multi-argument functions, partial application, 'where' clauses, multiple definitions of the same function with different patterns, implicit braces and semicolons inferred from layout, 'do' statements, if/then/else, [lists] -- all of these, and probably more, are great to use, but they all boil down to something like func = \arg -> let { ... } in case arg of { pat | guards -> f x y; ... } and perhaps fully grokking these essential constructs before moving on to using them indirectly through all the layers of pretty syntax would have helped me understand all those features better. ADDENDUM to forestall my inevitable hog-piling by pedants: yes, I know that 'let' isn't strictly essential, and I neglected to mention record fields, record updates, type classes, &c. Sorry. And I know that the Haskell standards have always defined higher-level constructs in terms of a core language. My point is that, at least for me, Haskell might have been easier had I been exposed to just that core language at first.
- nickpsecurity 10y agoInterestingly, most educational resources start with a core language or concepts then build on them. So your gripe seems intuitively correct.
- tel 10y agoTo do some reverse pedantry, actually that let is necessary but it's the one binding `func` that gets more use. It's a really interesting part of how ML-like languages do type inference that makes `let`s completely necessary.
- SatvikBeri 10y agoCompletely agree. This is one of the things I really like about the book Functional Programming in Scala, which builds from the ground up. I haven't found an equivalent book in Haskell.
- DarkContinent 10y agoWhy is this better than Learn You a Haskell for Great Good?
- xwowsersx 10y agoI'm not proposing that it's better, but it has a different focus. LYAH is, firstly, very long. Furthermore, it's difficult to get a sense for how real world programming a purely functional programming works from LYAH. You'll learn some of common FP constructs from LYAH, but you'll still be pretty far from being able to write real applications. The goal of this course is to keep the content pretty restricted to the few, main concepts that are used over and over again and to gain experience with practice and real examples. Hope that helps.