Skip to content

Instantly share code, notes, and snippets.

@hlian
Created January 25, 2015 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hlian/0cad06735aa03d87caf0 to your computer and use it in GitHub Desktop.
Save hlian/0cad06735aa03d87caf0 to your computer and use it in GitHub Desktop.
{
packageOverrides = pkgs:
let
haskellPackages = pkgs.haskell-ng.packages;
dontCheck = pkgs.haskell-ng.lib.dontCheck;
mapper = (p: dontCheck p);
in {
haskellEnv = haskellPackages.ghcHEAD.ghcWithPackages (p:
(map mapper [ p.lens ]) ++ [ p.cabal2nix ]
);
};
}
@hlian
Copy link
Author

hlian commented Jan 29, 2015

This is a working Haskell Nix environment that installs lens and whatever else you want without their testing dependencies --- which seems like it should be the default; I want to use wreq without installing Snap to run its tests!

Some things to note:

  • Lambdas are very weird in this language: x: y: z: expr
  • Lets have semicolons: let x = expr; y = expr; in expr
  • The only types are objects (curly braces representing a list of named attributes) and lists and numbers and booleans? It seems like a functional JSON. Haven't explored much
  • Modules are implemented with objects, which is weird! You can now pass modules around. I wish Haskell had first-class modules.
  • It's not obvious what any objects are named. I had to constantly flip between the nixpkgs repo on GitHub in order to type these long names, like pkgs.haskell-ng.lib.dontCheck.
  • Ultimately I couldn't get GMP to compile due to its using -rpath on OS X Yosemite. It looks like OS X needs some love in the Nix world. I'll try again on Linux in the future.
  • This seems strictly more powerful, like a virtualenv that you can program. Nix: ★★★★★

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment