7 ms·
Basics of Haskell – Code and exercises
- guerrilla 6y agoBartosz is always doing great stuff. Check out is Category Theory lectures for people who know Haskell: https://www.youtube.com/user/DrBartosz https://www.youtube.com/user/DrBartosz
- vrnvu 6y agoAlso I personally recommend to take a look to this series before diving into his great introductory book about category theory [1]. Seeing the application of the theoretical concepts and deriving the code yourself makes it more approachable for completly begginers from my experience. 1. https://github.com/hmemcpy/milewski-ctfp-pdf https://github.com/hmemcpy/milewski-ctfp-pdf
- ajarmst 6y agoI liked his introduction to Category Theory enough to buy the extremely well-done hardcover edition: https://www.blurb.com/b/9621951-category-theory-for-programmers-new-edition-hardco https://www.blurb.com/b/9621951-category-theory-for-programm... The only introductory treatment of Category Theory for non-specialists that I’ve encountered that even competes with it is Spivak’s “Category Theory for the Sciences.” For the curious, Eugenia Cheng’s books for lay audiences are excellent for getting a feel of the power and value of the Category Theoretical approach. Category Theory is somewhat unique in being a recently developed area of advanced maths that is nevertheless approachable with only modest formal training. Because it maps so well to much of the theory and practice of functional programming, most programmers with even a little interest and familiarity with that will be able to engage with the fundamentals, and Milewski does a masterful job of introducing it to that audience.
- orendon 6y agoIndeed, also a big fan of his category theory for programmers https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/ https://bartoszmilewski.com/2014/10/28/category-theory-for-p...
- quickthrower2 6y agoI’m a huge fan, but I struggled. And I studied math! The super abstract stuff I find hard. Once the categories become arrows themselves: I’m lost!
- bobbyz 6y agoMy university teaches the intro CS course in Racket (lisp), and I know another that teaches in Haskell. If decades of priority exposure to young programmers is not enough to spur widespread adoption, then I'm not hopeful.
- cinntaile 6y agoI don't think that's the point of having the intro CS course in a functional language. The concepts that you get taught there can also be applied outside of pure functional languages and they teach you a different way to think about programming.
- rowanG077 6y agoI think most programmers aren't actually coming from university currently.
- grogenaut 6y agoI did my interpreter class in Scheme in university. The main thing it taught me was I never wanted to use scheme (or lisp) and put me off of functional programming for many years. I re-did the interpreter from that class in C++ and it made insanely more sense to me than the scheme version. I could see where scheme was going and why it was a good fit but just hated it. That same professor taught our C++ class (while learning it, they had someone quit) the next semester and they had to actually do a do-over he was so bad at C++. To his credit he knew as much half way through the semester (he had students getting ahead of him). He basically nop'd out of C++ like I did out of Scheme. It just didn't fit his brain.
- mateioprea 6y agoWe learned Scheme, Haskell, Prolog and Clips in one semester for Programming Paradigms course. I can still remember the homework for each programming language (this was 6 years ago): - Something with genetic algorithms in Scheme - 2048 implementation in Haskell - Searching in an infinite space in Prolog - Phutball in Clips Pretty dope if you ask me. :)
- siraben 6y agoWriting interpreters in Haskell (which is what some of the lessons seem to be about) is a great way to learn the language. It naturally motivates recursion, algebraic data types, strong types, higher-order functions and later, when effects such as state and errors are needed, monads arise naturally. The best part? It takes a ridiculously small amount of code to do all that, maybe around a hundred or less. Languages without ADTs and higher-order functions bend over backwards to recover them[0] via design patterns. [0] http://www.cs.ox.ac.uk/jeremy.gibbons/publications/hodgp.pdf http://www.cs.ox.ac.uk/jeremy.gibbons/publications/hodgp.pdf
- mason55 6y agoIt also introduces you to the expression problem pretty quickly and organically :) I agree with the comment though. I learned Haskell and how to write an interpreter at the same time by working through the book Crafting Interpreters. It was a great match.
- dustingetz 6y agocompiler, evaluator constructs should be the bottom of the next set of mainstream languages (possibly being born today by former haskell programmers?) imagine free monad lisp
- lubesGordi 6y agoAgreed! I've been trying to learn haskell for a long time, and this guy writes a json parser live, giving his intuition along the way. It's helped me immensely. https://www.youtube.com/watch?v=N9RUqGYuGfw https://www.youtube.com/watch?v=N9RUqGYuGfw
- pjmlp 6y agoBack when I did my degree, Haskell still wasn't a thing, like it was giving its first steps. So the choice would be Lisp, Prolog, Caml Light, or the recently released Objective Caml. The year before I took compilers design project, the TA responsible for it used to disallow them from the implementation language option list, as it would make the assignment too easy.
- vajrabum 6y agoHere is the tutorial that goes with that code. Unfortunately the School of Haskell is now read only so they aren't dynamic in the browser anymore. https://www.schoolofhaskell.com/school/starting-with-haskell/basics-of-haskell https://www.schoolofhaskell.com/school/starting-with-haskell...
- buddhiajuke 6y agoMilewski has the best video lectures on category theory that I know of. Thanks for your contributions, Bartosz!
- moralestapia 6y agoBartosz truly deserves to be more widely known. His Category Theory for Programmers book is an excellent introduction to the CT world if you come from a Computer Science background (well ... duh it says it right there in the title) and know very little math. Highly recommended to give it a try, even if the topic doesn't seem to fit you. This is one of those books that will make you a better programmer regardless of what you do.
- mateioprea 6y agoI also recommend http://learnyouahaskell.com/ http://learnyouahaskell.com/. Super cool and easy to understand
- chillee 6y agoI think that a lot of people find that LYAH makes you feel like you're learning, but have difficulty actually applying/using the concepts. This is compounded by the lack of exercises. I definitely agree with this review: https://bitemyapp.com/blog/functional-education/ https://bitemyapp.com/blog/functional-education/ > The material often bores learners and leaves them feeling like they're not "getting" it. This is because they're being "talked at" and demo'd to. They're not engaging with and solving problems.
- somewhereoutth 6y agoWould it not be great if instead of a programming language being handed down to us as if made of stone, it was seen as a particular expression of a set of ideas (some good, some bad), much as music is, that we could relate and respond to in the same spirit?
- quickthrower2 6y agoSounds like you are talking of lisp.
- uryga 6y agoi think a better analogy would be [programming techniques as "musical ideas", programming languages as instruments]. you can pick an instrument that fits what want to do, or build a new one if you know how :)
- doomjunky 6y agoThe programming course at my university taught us the fundamental paradigmens. The languages were chosen only as examples. Imperativ / OOP => Java Functional => Haskell Logic => Prolgo
- doomjunky 6y agoHaskell is actually very easy. This is just my heuristic but Haskell has just 25 keywords. For comparison: C 32, Java 53, C++ 83 and C# 102. What makes Haskell confusing are the 115 GHC language extensions. Each is basically a new concept to learn. Every time i join a new and sufficiently large project, I stumble across an extension that I am not familiar with. https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html https://downloads.haskell.org/~ghc/latest/docs/html/users_gu...
- tome 6y agoOften extensions make the language easier to understand, by removing arbitrary restrictions that you wouldn't have expected to be there in the first place.