I’m finalizing my short tutorial on Nix for Haskell programmers. If you are a Haskell programmer, and if you feel like something could be explained in this tutorial, please let me know!
Nice! Some comments how to improve further:
- inline shebang snippet
- haskell.nix for more complicated setups
Thanks! I’ve improved in the article taking your two comments.
Thanks for this work ! I’m struggling with stack thus I would be interested to read more about how it relates to Nix. However it may not be part of the topic you want to cover…
Have you tried adding a
default.nix (as the article suggests here) to your exercism exercise project, and used exclusively Nix (no stack) to build it?
default.nixusing the snippet in the article
nix-shell --run ghcid
(ghcid will recompile as you edit the sources)
If you use
ghcid -T main it will even run it.
I will try it, thanks.
nix-shell --run ghcid outputs same error as with stack
stm > /run/user/1000/stack-7a9824c190b5454b/stm-126.96.36.199/Control/Monad/STM.hs:34:9: error: Not in scope: ‘always’ stm > | stm > 34 | always, stm > | ^^^^^^ stm > stm > /run/user/1000/stack-7a9824c190b5454b/stm-188.8.131.52/Control/Monad/STM.hs:35:9: error: Not in scope: ‘alwaysSucceeds’ stm > | stm > 35 | alwaysSucceeds, stm > | ^^^^^^^^^^^^^^ Error: -- While building package stm-184.108.40.206 using: /home/jlucas/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_220.127.116.11_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-18.104.22.168 build --ghc-options "" Process exited with code: ExitFailure 1
This seems like an error with the cabal configuration of the project, doesn’t it ? (I am a newbie with cabal and stack).