6 ms·
What i wish i knew when learning haskell
- unhammer 10y agoThis is such a great reference. The best part is that it's continually updated: https://github.com/sdiehl/wiwinwlh/commits/master https://github.com/sdiehl/wiwinwlh/commits/master
- sid-kap 10y agoWhoa, didn't know he was still updating it! Last year he announced that he was done working on it: http://www.stephendiehl.com/posts/docs.html http://www.stephendiehl.com/posts/docs.html
- baldfat 10y agoI tried to use Haskell three times. Cabal was the always the reason why I left. I use three different machines. 2 at two different locations at work and one at home. All three would be different and have different errors. I would spend hours and always left with a horrible taste in my mouth. Today I use Racket and I won't go back but I am glad Stack is taking over Cabal.
- cauterize 10y agostack uses cabal underneath, but your point stills stands that cabal has been historically hard to use.
- danieldk 10y agoCabal was the always the reason why I left. It is not only Cabal, but also the constant churn in a lot of packages. For example, conduit was a great package when I used Haskell. But usually I had to update quite a bit of code when I would bump conduit up to the latest version after not touching a program for a year. Maybe I have been unlucky enough to use Haskell during some transitions (pre-arrows -> arrows rule, let's use them everywhere -> arrows suck, basic IO monad -> iteratees, old fashioned field access -> various lens proposals -> lens). But I never used a language ecosystem before or after where things would change or break so often.
- IngoBlechschmid 10y agoYes, there have been quite a few transitions happening. They didn't happen "for fun", but because it had been felt that the optimal solutions were not found yet (optimal as in elegant, easy to use, maintainable, ...). Luckily, Haskell's static typing coupled with the extremely helpful error messages of the compiler makes refactoring a cheerful task: If it worked before and all type errors have been fixed, then we can be quite confident that it works again. Many areas have stabilized now. For instance, Edward Kmett's lens package is the de facto standard for all things related to records, getters, setters, and all those things on steroids. (Personally, I love how this turned out. Before lens, we quite frankly had the problem that field accesses were much more painful than they are in mainstream object-oriented languages like Python or Java. Nowadays field accesses are as simple as they are in other languages, and in addition to this we have the flexibility of composable first-class lenses.)
- dllthomas 10y ago> all type errors have been fixed ... by someone trying to actually address the issues. There are almost always wrong ways you can fix a type error. Fortunately, that's usually the situation at hand...
- chongli 10y agoThe number one mistake they made was in deciding to make the package database stateful. Such an odd choice for a language so focused on purely functional programming. Packages should be pure functions, with the final result being a read-only cache. This is how Nix [0] works and it makes everything else seem like a bad idea by comparison. [0] https://nixos.org/nix/ https://nixos.org/nix/
- WmyEE0UsWAwC2i 10y agoI started using haskell before stack but after cabal sandboxes. Once I learned to use sandboxes cabal gave no problem. I don't understand why it keeps receiving so much heat. What does stack do that cabal can't?
- dllthomas 10y agoWith sandboxes, I had little-to-no trouble developing individually on a single machine. I sometimes ran into issues trying to get the same thing building elsewhere.
- hota_mazi 10y agoWhenever I tried to use cabal, I always came up realizing how lucky we are on the JVM with Maven and Gradle. It's mystifying the Haskell community still hasn't been able to come up with a decent dependency management + build tool.
- IngoBlechschmid 10y agoThere are a couple of peculiarities of Haskell's module system which made it difficult, but yes, I agree that it took longer than it should have. However, nowadays there is a decent dependency management and build tool! It's called "stack", as in "stack install xmonad". I never once had any dependency or other compile problems with stack. It simply always works. :-)
- andolanra 10y agoI've had a lot of problems with Stack whenever I'm doing non-trivial (that is, beyond just "build this executable the standard way") kinds of tasks—in particular, it tends to corrupt its package DB after a while for mysterious reasons, and you have to blow it away and rebuild, and it can be a nightmare to do certain bits of configuration where the UI is undocumented or nonexistant—but it's a pretty big step up from historical Cabal. There's also an already-working-but-still-not-quite-finished alternative system within Cabal which is eventually gonna become the default one, and which does builds in a Nix-inspired way. I've been using that for the better part of a year now, and I like it far better than either historical Cabal or Stack: http://blog.ezyang.com/2016/05/announcing-cabal-new-build-nix-style-local-builds/ http://blog.ezyang.com/2016/05/announcing-cabal-new-build-ni...
- dllthomas 10y ago> it tends to corrupt its package DB after a while for mysterious reasons, and you have to blow it away and rebuild Odd, I've been using stack in anger for a while now and have never had that happen. Have you reported a bug? Any ideas about reproduction?
- 10y ago
- tux1968 10y agoGood advice about how to grok monads. An oldish but still useful video takes a similar concrete approach to building up the idea from simple examples: https://www.youtube.com/watch?v=w_KY2I34-f8 https://www.youtube.com/watch?v=w_KY2I34-f8
- DonbunEf7 10y agoTwo things missing that I wish I knew when I had learned Haskell. First, Haskell is just another programming language. It has many papers written about it, and many people have strong opinions about it, but at the end of the day it is not that special. Second, the Haskell community is not friendly and welcoming to many groups of folks. In particular, if you are a fan of dynamic/gradual typing, objects, distributed systems, etc. do not expect a warm welcome. A personal anecdote: I left #haskell on Freenode because a regular and popular user proposed and endorsed an extended analogy wherein all humans are divided into "dynamically-typed" and "statically-typed" people, and statically-typed people are superior because they are more reliable. This kind of bias pervades the community and ruins any kind of cross-ecosystem collaborative efforts. Edit: Was I being confrontational? I wasn't even part of this conversation! I was lurking, and I saw this ridiculous thing play out unprompted between regulars.
- Buttons840 10y agoIn my opinion the Haskell community is friendly and an endless source of new ideas and concepts to learn from. > if you are a fan of dynamic/gradual typing, objects, distributed systems, etc. do not expect a warm welcome. I have not experienced this, but this might be because when I'm participating in the Haskell community I mostly talk about Haskell. I'm a fan of Python and Elixir, and haven't kept these facts secret as I've participated in the Haskell community (including a local meetup who's organizer is also a fan of Erlang/Elixir), and nobody has singled me out to bully me because of this. Nobody even notices.
- IngoBlechschmid 10y ago> In my opinion the Haskell community is friendly and an endless source of new ideas and concepts to learn from. This is also my experience! I received a very warm welcome when I first started with Haskell. You could ask all sorts of questions on #haskell and always receive great answers. The regulars were really happy when they were able to help you. Also they were not dismissive at all in view of my background in dynamic programming languages. In fact, several members of the Haskell community were quite interested in Pugs, the experimental Perl 6 platform which we built in Haskell in those days, to the extent that they joined our effort and became committers. :-) There was quite a bit of cultural exchange happening. The legendary #haskell troll attempt, recorded at https://gist.github.com/quchen/5280339 https://gist.github.com/quchen/5280339, is worth reading. Partly to pay back the kindness I received back then, and partly just because it's so much fun, I participate in free regional Haskell workshops. If you are located near Augsburg, Germany feel invited to attend! Details are at http://curry-club-augsburg.de/ http://curry-club-augsburg.de/.
- fixed_carbon 10y agoAs a relative newbie to Haskell, the linked document contains a lot of information that I had wondered about but hadn't found definitive answers for (eg. Should I be using String at all?) as well as a wealth of information I hadn't even thought to ask yet. I suspect it's going to live in a browser tab next to Hoogle until I get a lot more experience. Favorite line: "Playing "type-tetris" to convert between Strings explicitly can be frustrating." Such understatement! Converting between string types and dealing with the lack of scoping in records have been two major pinch points for me with Haskell so far. Most puzzling part: The description of Erlang as an imperative language.
- dllthomas 10y agoI had a reading group going through this, top to bottom. The chance to stop and discuss things was a big win.