Commit graph

1624 commits

Author SHA1 Message Date
Russell O'Connor
d4bd4650d6 Rework the knot-tying code for defining Haskell packages.
The existing knot-tying code I felt was a bit incoherent with result, finalReturn, self, refering to different various forms of the "haskellPackages" value and often
different forms in the same place.

This commit instills some object-oriented discipline to the construction of hasekllPackages using a small number of fundamental OO concepts:

* An class is a open recursive function of the form (self : fooBody) where fooBody is a set.
* An instance of a class is the fixed point of the class.
  This value is sometimes refered to as an object and the values in the resulting set are sometimes refered to as methods.
* A class, foo = self : fooBody, can be extended by an extension which is a function bar = (self : super : barBody) where barBody a set of overrides for fooBody.
  The result of a class extension is a new class whose value is self : foo self // bar self (foo self).
  The super parameter gives access to the original methods that barBody may be overriding.

This commit turns the haskell-packages value into a "class".

The knot-tying, a.k.a the object instanitation, is moved into haskells-defaults.  The "finalReturn" is no longer needed and is eliminated from the body of
haskell-packages. All the work done by prefFun is moved to haskell-defaults, so that parameter is eliminated form haskell-packages.  Notice that the old prefFun took
two pameters named "self" and "super", but both parameters got passed the same value "result".  There seems to have been some confusion in the old code.

Inside haskell-defaults, the haskell-packages class is extended twice before instantiation.  The first extension is done using prefFun argument.
The second extension is done the extension argument, which is a renamed version of extraPrefs.

This two stage approach means that extension's super gets access to the post "perfFun" object while previously the extraPrefs only had access to the pre "prefFun"
object.  Also the extension function has access to both the super (post "perfFun") object and to self, the final object.  With extraPrefs, one needed to use the
"finalReturn" of the haskell packages to get access to the final object.  Due to significant changes in semantics, I thought it best to replace extraPrefs with
extension so that people using extraPrefs know to update thier cod.

Lastly, all the Prefs functions have renamed the "self" parameter to "super".  This is because "self" was never actually a self-reference in the object oriented sense
of the word.  For example

    Cabal_1_18_1_3 = self.Cabal_1_18_1_3.override { deepseq = self.deepseq_1_3_0_2; };

doesn't actually make sense from an object oriented standpoint because, barring further method overriding, the value of Cabal_1_18_1_3 would be trying to override it's
own value which simply causes a loop exception.  Thankfully all these uses of self were really uses of super:

    Cabal_1_18_1_3 = super.Cabal_1_18_1_3.override { deepseq = super.deepseq_1_3_0_2; };

In this notation the overriden Cabal_1_18_1_3 method calls the Cabal_1_18_1_3 of the super-class, which is a well-founded notion.

Below is an example use of using "extension" parameter

{
  packageOverrides = pkgs : {
    testHaskellPackages = pkgs.haskellPackages.override {
      extension = self : super : {
        transformers_0_4_1_0 = self.cabal.mkDerivation (pkgs: {
        pname = "transformers";
        version = "0.4.1.0";
        sha256 = "0jlnz86f87jndv4sifg1zpv5b2g2cxy1x2575x727az6vyaarwwg";
        meta = {
          description = "Concrete functor and monad transformers";
          license = pkgs.stdenv.lib.licenses.bsd3;
          platforms = pkgs.ghc.meta.platforms;
          maintainers = [ pkgs.stdenv.lib.maintainers.andres ];
        };
       });

      transformers = self.transformers_0_4_1_0;

      lensFamilyCore = super.lensFamilyCore.override { transformers = self.transformers_0_3_0_0; };
     };
   };
 };
}

Notice the use of self in the body of the override of the transformers method which references the newly defined transformers_0_4_1_0 method.

With the previous code, one would have to instead akwardly write

      transformers = super.finalReturn.transformers_0_4_1_0;

or use a rec clause, which would prevent futher overriding of transformers_0_4_1_0.
2014-05-08 12:01:45 -04:00
Peter Simons
4ee0cd2bbb haskell-gloss: Revert "update to version 1.8.2.1"
This reverts commit 37df971a49. The new
version doesn't compile.
2014-05-07 19:13:06 +02:00
Peter Simons
ee1a03577c haskell-statistics: drop obsolete version 0.10.5.2 2014-05-07 19:13:06 +02:00
Peter Simons
6f5ee37d5c haskell-HTTP: update to version 4000.2.14 2014-05-07 19:13:04 +02:00
Peter Simons
af8d34c35e Merge pull request #2531 from jwiegley/djinn
Add an expression for the Haskell library djinn
2014-05-07 11:36:56 +02:00
Oliver Charles
fcc3ae1d84 haskellPackages.snapletStripe: New expression 2014-05-07 09:57:27 +01:00
Shea Levy
0d0f7d2681 Merge branch 'buildLocalCabal-drvArgs' of git://github.com/proger/nixpkgs
buildLocalCabal: allow drvArgs in buildLocalCabalWithArgs
2014-05-06 09:27:40 -04:00
Peter Simons
81a05aabbe haskell-packages.nix: update (unused) reference to cabal-install 2014-05-06 10:59:23 +02:00
Vladimir Kirillov
7eff825487 buildLocalCabal: allow cabalDrvArgs in buildLocalCabalWithArgs
allows to write neat expressions like (as we're still generating an
expression string):

```
{
  build = haskellPackages.buildLocalCabalWithArgs {
    inherit src name;
    cabalDrvArgs = {
      jailbreak = false;
      doCheck = false;
    };
  };
}
```

without resorting to weird kung-fu like darcs does:

```
darcs = haskellPackages.darcs.override {
  # A variant of the Darcs derivation that containts only the
  # executable and
  # thus has no dependencies on other Haskell packages.
  cabal = { mkDerivation = x: rec { final = haskellPackages.cabal.mkDerivation (self: (x final) // {
            isLibrary = false;
            configureFlags = "-f-library"; }); }.final;
          };
};
```

While here, move the `jailbreak = true;` as the default `cabalDrvArgs`
option.
2014-05-06 11:00:48 +03:00
John Wiegley
7848f96b58 Add an expression for the Haskell library djinn 2014-05-05 19:48:50 -05:00
Vladimir Kirillov
9aa231abfa buildLocalCabal: include cabalInstall to buildDepends to preserve developer experience 2014-05-05 14:43:55 +03:00
Peter Simons
66997bba1e haskell-gloss: require the latest OpenGL and GLUT libraries 2014-05-05 10:54:12 +02:00
Peter Simons
dbb561ae62 haskell-packages.nix: strip trailing whitespace 2014-05-05 10:52:11 +02:00
Peter Simons
f5a6b58374 cabal-install: update to version 1.20.0.1 2014-05-05 10:46:40 +02:00
Peter Simons
986a42dfe7 haskell-cabal-lenses: add version 0.1 2014-05-05 10:46:39 +02:00
Peter Simons
e7c207e10d haskell-hourglass: add version 0.1.1 2014-05-05 10:46:39 +02:00
Peter Simons
401f4a28c1 cryptol: fix reference to text library 2014-05-04 23:21:39 +02:00
Benno Fünfstück
d385835c38 haskell-profiteur: new expression 2014-05-04 23:02:46 +02:00
Peter Simons
18f49692ec haskell-wreq: fix reference to attoparsec 2014-05-04 22:25:56 +02:00
Peter Simons
911d9d5b1b Merge pull request #2489 from jwiegley/haskexprs
Add several new Haskell expressions
2014-05-04 13:22:13 +02:00
Peter Simons
ce21d883c0 haskell-vinyl: add version 0.3 2014-05-04 13:19:56 +02:00
Peter Simons
c2fd001fd4 Remove obsolete Agda-executable package; the compiler is not part of 'Agda'. 2014-05-04 12:17:35 +02:00
John Wiegley
9bc6893712 Add several new Haskell expressions 2014-05-03 23:01:00 -05:00
Peter Simons
4b307a7b96 haskell-network: update to version 2.5.0.0 2014-05-03 20:03:33 +02:00
Peter Simons
dd1dd06b88 haskell-text: update to version 1.1.1.1 2014-05-03 20:03:32 +02:00
Peter Simons
c1705e8b33 haskell-fgl: add version 5.5.0.1 2014-05-03 20:03:32 +02:00
Peter Simons
eb7958247a haskell-unordered-containers: update to version 0.2.4.0 2014-05-03 20:03:32 +02:00
Peter Simons
074c128fec haskell-attoparsec: update to version 0.11.3.0 2014-05-03 20:03:32 +02:00
Vladimir Kirillov
599f9a09fe haskell: bump ekg to 0.4, add ekg-core 2014-05-03 17:36:03 +03:00
Peter Simons
64d662e056 Agda: move compiler and standard library into a common directory
Also renamed AgdaStdLib attribute to AgdaStdlib, since upstream doesn't
seem to capitalize that name.
2014-05-03 12:37:17 +02:00
Peter Simons
801a4818c8 Merge pull request #2474 from jwiegley/agda-stdlib
Add expression for the Agda standard library
2014-05-03 12:33:26 +02:00
Mateusz Kowalczyk
ab7e2f1dc5 haskell-HTTP: update to version 4000.2.13 2014-05-03 12:27:25 +02:00
Oliver Charles
4e70c764f5 Merge pull request #2473 from jwiegley/these
Add expression for Haskell library 'these'
2014-05-03 11:19:18 +01:00
John Wiegley
7d788d5e4f Add expression for the Agda standard library 2014-05-02 19:15:38 -05:00
John Wiegley
fb778b705f Add expression for Haskell library 'these' 2014-05-02 13:43:34 -05:00
Peter Simons
e81ac36bff haskell-spoon: add version 0.3.1 2014-05-01 21:57:02 +02:00
Peter Simons
39c3cb1d99 haskell-groom: add version 0.1.2 2014-05-01 21:57:02 +02:00
Benno Fünfstück
8310c6a403 haskell-cabal-bounds: use versionOlder
for some reason, versionAtLeast doesn't work
2014-05-01 15:02:50 +02:00
Peter Simons
979520396e Merge pull request #2311 from bennofs/haskell-cabal-bounds
haskell-cabal-bounds: New expression
2014-05-01 14:53:10 +02:00
Benno Fünfstück
e914f15728 haskell-cabal-bounds: avoid rebuild of Cabal 2014-05-01 14:51:06 +02:00
Peter Simons
d4ceed5f2a haskell-hspec: the limitation on QuickCheck 2.7 has been lifted recently 2014-05-01 14:37:09 +02:00
Tom Dimiduk
c4f66df29a add zeromq4 and zeromq4-haskell 2014-05-01 07:52:21 -04:00
John Wiegley
3988f438ef Add expression for the Haskell posix-paths library 2014-04-30 17:19:34 -04:00
Austin Seipp
d9d76f1a3a cryptol: add 1.8.x expression
This also includes support for the verification tools I'm using. Cryptol
2 is still the default obviously.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-04-29 17:50:55 -05:00
Benno Fünfstück
3685bf378f haskell: new expression cabal-bounds 2014-04-29 19:19:10 +02:00
Peter Simons
e8ba2d4ded haskell-packages.nix: switch ghc-head to cabal-install 1.20.x.x 2014-04-29 01:35:45 +02:00
Peter Simons
2bf7311b3f haskell-packages.nix: cosmetic 2014-04-29 01:35:45 +02:00
Peter Simons
192ef70a7c haskell-prelude-extras: add version 0.4 2014-04-29 01:35:45 +02:00
Peter Simons
75da9d640e Merge pull request #2374 from klao/tz
Add tzdata and tz Haskell packages
2014-04-26 16:06:55 +02:00
Oliver Charles
f6e8b77294 Merge pull request #2399 from ttuegel/hmatrix-special
Add haskell-hmatrix-special-0.2.0
2014-04-26 09:58:37 +01:00
vi
74efbde57c Derivation for the Haskell library, "bv". 2014-04-26 16:17:04 +08:00
Thomas Tuegel
7c274bf958 Add haskell-hmatrix-special-0.2.0 2014-04-25 17:17:47 -05:00
Mihaly Barasz
8bb3f19c6b Add tz Haskell package 2014-04-25 16:21:50 +02:00
Mihaly Barasz
2d37f8ecf0 Add tzdata Haskell package 2014-04-25 16:21:50 +02:00
mornfall
abe9fb340e Merge pull request #2390 from ertes/ertes-haskell-jack
haskell: Added enumset and jack.
2014-04-25 14:28:13 +02:00
Ertugrul Söylemez
a3a2222fec haskell: Added enumset 0.0.4 and jack 0.7.0.2. 2014-04-25 14:03:57 +02:00
Oliver Charles
5de0ca50d7 Merge pull request #2389 from bennofs/haskell-ghc-gc-tune
haskell-ghc-gc-tune: new expression
2014-04-25 12:12:57 +01:00
Austin Seipp
5401849e3a cryptol v2.0.0
This comes with several extra libraries, including GraphSCC, monadLib,
presburger, process and smtLib, all required as build dependencies. But
otherwise totally automated via cabal2nix.

Next up is CVC4 (a total pain in the ass to package) for proving/SAT
support.

I have another WIP branch for the unfree 1.x series which I may (or may
not) add later as it has external verification tech at the moment.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-04-25 05:42:00 -05:00
Benno Fünfstück
027319708e haskell-ghc-gc-tune: new expression 2014-04-25 12:33:07 +02:00
Oliver Charles
cb82334421 Merge pull request #2336 from jwiegley/cabal
Add expression for cabal-install 1.20.0.0
2014-04-25 10:55:12 +01:00
Oliver Charles
954bc3131e haskellPackages.wreq: New expression 2014-04-25 10:33:23 +01:00
Oliver Charles
2fde59d20f Merge pull request #2356 from hrdinka/haskell-msgpack
haskell-msgpack: add version 0.7.2.5
2014-04-25 10:31:45 +01:00
Oliver Charles
4ccda3324f Merge pull request #2369 from fmap/master
New package: lists and its dependency, list-extras (Haskell.)
2014-04-25 10:18:57 +01:00
Shea Levy
c7f2d87a56 Add haskell-http-kit 2014-04-24 13:06:01 -04:00
vi
a16098995a New package: lists and its dependency, list-extras (Haskell.) 2014-04-24 17:41:40 +08:00
Christoph Hrdinka
6b1d20abe8 haskell-msgpack: add version 0.7.2.5 2014-04-23 10:06:19 +02:00
Shea Levy
5701e4e15a Add buildLocalCabalWithArgs for providing extra arguments to callPackage 2014-04-20 22:57:03 -04:00
John Wiegley
a07455dd16 Add expression for cabal-install 1.20.0.0 2014-04-20 14:04:41 -05:00
John Wiegley
599c2775dd Add expression for xml-lens 2014-04-19 11:21:15 +01:00
Michael Raskin
f45bcfb5e9 Merge pull request #2298 from jwiegley/hfsevents
Add hfsevents expression, and make fsnotify use it on darwin
2014-04-18 10:42:16 -07:00
John Wiegley
0556bc0fcb Add hfsevents expression, and make fsnotify use it on darwin 2014-04-16 16:43:32 -05:00
John Wiegley
df56712700 The timeparsers library requires convertible == 1.0.* 2014-04-16 13:09:31 -05:00
Peter Simons
d4097e4e0e Merge pull request #2273 from jwiegley/cabal-delete
Add expression for cabal-delete
2014-04-16 10:17:29 +02:00
John Wiegley
f2690384c9 Three new Haskell tools: rehoo, una, cabal-meta 2014-04-15 04:32:06 -05:00
John Wiegley
00d5f3ab79 Add expression for cabal-delete 2014-04-15 04:16:55 -05:00
Lukas Toth
f5fa89f198 haskellPackages.Unixutils: New expression 2014-04-15 10:43:38 +02:00
Lukas Toth
66e750190f haskellPackages.bzlib: New expression 2014-04-15 10:43:38 +02:00
Lukas Toth
cf63d8953c haskellPackages.Extra: New expression 2014-04-15 10:43:38 +02:00
Lukas Toth
1ae0fec71b haskellPackages.ipprint: New expression 2014-04-15 10:43:38 +02:00
John Wiegley
d5898b3733 Add the Haskell system utility "sizes" 2014-04-15 02:28:02 -05:00
Oliver Charles
7f4afcda7e Merge pull request #2235 from bennofs/haskell-monad-extras
haskell: add monad-extras
2014-04-13 12:11:27 +01:00
Benno Fünfstück
7fed418b24 haskell: add monad-extras 2014-04-13 10:19:30 +02:00
John Wiegley
0ef3c47778 Add recipes for a few Haskell libraries 2014-04-12 10:22:37 -05:00
Oliver Charles
1b7a8e6f5b Merge pull request #2217 from bennofs/haskell-uri
Add uri haskell package
2014-04-12 16:09:46 +01:00
Oliver Charles
99d8ef0673 haskellPackages.snapCORS: New expression 2014-04-12 16:04:40 +01:00
Benno Fünfstück
796ea8ee11 haskell: add uri package 2014-04-12 16:59:29 +02:00
Peter Simons
f32be2da85 haddock: update to version 2.14.2 2014-04-11 22:33:11 +02:00
Peter Simons
86177f06e9 haskell-haskell-src: add version 1.0.1.6 2014-04-11 22:33:11 +02:00
Peter Simons
f5dd4d383b haskell-HTTP: update to version 4000.2.12 2014-04-11 22:33:11 +02:00
Peter Simons
e1bdc5c164 haskell-statistics: add version 0.11.0.0 2014-04-11 22:33:11 +02:00
Peter Simons
ea95516bf8 haskell-parsers: add version 0.11 2014-04-11 22:33:11 +02:00
John Wiegley
8026caec43 Add c2hsc to haskell-packages.nix 2014-04-11 10:34:56 -05:00
Peter Simons
9818422bc0 Merge pull request #2203 from fmap/language-c-inline
New derivation: language-c-inline (haskell)
2014-04-11 11:45:45 +02:00
Peter Simons
b62ac3995c haskell-hastache: remove obsolete version 0.5.1 2014-04-11 09:53:16 +02:00
vi
7839df9a09 New derivation: language-c-inline (haskell) 2014-04-11 10:20:21 +08:00
Oliver Charles
18039f52bb Merge pull request #2181 from fmap/stuff
Derivations for HandsomeSoup and hxt-xpath (Haskell.)
2014-04-09 12:04:55 +01:00
vi
09e245b3ab Derivations for HandsomeSoup and hxt-xpath (Haskell.) 2014-04-09 18:36:49 +08:00
Peter Simons
9b4e914dac Merge pull request #2171 from ocharles/remove-lens-aeson
Remove haskellPackages.lensAeson
2014-04-09 11:53:07 +02:00
Oliver Charles
f251d0d386 Remove haskellPackages.lensAeson
This is now part of haskellPackages.lens
2014-04-08 17:21:47 +01:00
Austin Seipp
57cfb4315e haskell: sbv 3.0
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-04-08 10:12:58 -05:00