6 ms·
Try using nix instead. Aside from being a fantastic package manager for many languages it’s a godsend for Haskell. The lengthy compilation times with Haskell ar
by thinkpad20 7y ago
Try using nix instead. Aside from being a fantastic package manager for many languages it’s a godsend for Haskell. The lengthy compilation times with Haskell are one of the not so wonderful parts of the language, but they largely disappear with nix, and the Haskell ecosystem on nix is very well supported, with a large community. Honestly I’ve been developing Haskell for years and have never once used stack. I did use cabal before I discovered nix, but since then I’d hardly dream of using anything else.
- mlevental 7y agohow does nix eliminate compile times???
- thinkpad20 7y agoIt doesn’t eliminate them entirely; it’s just very smart about allowing packages to be built exactly once, and having a deterministic output such that it can be determined before a package is built whether a prebuilt version is available. This prebuilt version can either be the result of a previous build on your machine, or on another machine served from a repository. Of course, there are times when you need to compile yourself, but most slow-to-compile packages, such as Aeson, Lens, Servant or the aforementioned Parsec, and many more on top of that have prebuilt binaries available when built from community snapshots (nixpkgs/nixos). You can even pin your package definitions to guarantee that you’re building something that will have prebuilt versions available. New project build is usually less than a minute or two, sometimes substantially so (anecdotally). Again, not always, but usually.
- deleted 7y ago[deleted]
- leoh 7y agoLooks like it offers precompiled packages: > Nix lets you download precompiled Hackage packages whereas stack compiles them on your computer the first time you depend on them Source: https://github.com/Gabriel439/haskell-nix#background https://github.com/Gabriel439/haskell-nix#background
- deleted 7y ago[deleted]
- verttii 7y agoI didn't know about this, glad I read your comment. Stack/cabal is painful.
- allenleein 7y agoFor Nix and Haskell in production, I highly recommend this resource: https://github.com/Gabriel439/haskell-nix https://github.com/Gabriel439/haskell-nix More free resources about learning Haskell: 1. https://github.com/allenleein/brains/blob/master/Zen-of-Functional-Programming/zen.md https://github.com/allenleein/brains/blob/master/Zen-of-Func... 2. https://github.com/allenleein/brains/tree/gh-pages/Zen-of-Functional-Programming https://github.com/allenleein/brains/tree/gh-pages/Zen-of-Fu...
- behnamoh 7y agoThanks for introducing these. But a question I've been asking is what's the optimum way to start learning Haskell? There're tens of books in the links you mentioned, mostly ranging >400 pages. Obviously it's not efficient to read them all and then decide which was the best. On the other hand, with Haskell evolving all the time, I worry if I start a book I might miss out on some other stuff covered in other books.
- allenleein 7y agoPlease start from this book: Haskell Programming From First Principle (The most popular in community) https://github.com/allenleein/brains/blob/master/Zen-of-Functional-Programming/Haskell%20Programming%20From%20First%20Principle.pdf https://github.com/allenleein/brains/blob/master/Zen-of-Func...
- behnamoh 7y agoThanks! I've heard about the authors. Just out of curiosity, how does Learn You a Haskell for Great Good stack up against other resources? (heard a great deal about it here and there.)
- leoh 7y agoThanks for mentioning this. It's a bit hard to get started as the signal:noise ratio is pretty bad. Not because there's bad info out there, per se, but there's a lot of _old_ information out there and it feels hard to (a) stay up to date with what's best and (b) it _seems_ like stuff is still being figured out. The success of Python, I think, is largely due to pip; the success of Ruby due to bundler; the continued relative success of Java due to maven, etc. And it seems to me Haskell is still figuring this out.
- renox 7y agoFunny,I tried two years ago to use Nix to have a new onegcc on an old Linux OS, I didn't succeed and finally recompiled gcc from the sources which I found much easier (and better documented) than using Nix.