-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A benchmark of random-fu (replacing mwc-random)
- Loading branch information
1 parent
19be760
commit 60a4e3d
Showing
4 changed files
with
110 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,67 @@ | ||
( | ||
import | ||
( | ||
let | ||
lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
in | ||
fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; | ||
} | ||
) | ||
{src = ./.;} | ||
) | ||
.shellNix | ||
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }: | ||
|
||
let | ||
|
||
inherit (nixpkgs) pkgs; | ||
|
||
f = { mkDerivation, abstract-par, base, brick, containers | ||
, criterion, directory, foldl, free, histogram-fill, hspec, ieee754 | ||
, integration, lens, lib, linear, log-domain, math-functions | ||
, matrix, monad-coroutine, monad-extras, mtl, mwc-random | ||
, optparse-applicative, pipes, pretty-simple, primitive, process | ||
, QuickCheck, random, random-fu, safe, scientific, statistics, text, time | ||
, transformers, typed-process, vector, vty | ||
}: | ||
mkDerivation { | ||
pname = "monad-bayes"; | ||
version = "1.2.0"; | ||
src = ./.; | ||
isLibrary = true; | ||
isExecutable = true; | ||
libraryHaskellDepends = [ | ||
base brick containers foldl free histogram-fill ieee754 integration | ||
lens linear log-domain math-functions matrix monad-coroutine | ||
monad-extras mtl mwc-random pipes pretty-simple primitive random random-fu | ||
safe scientific statistics text vector vty | ||
]; | ||
executableHaskellDepends = [ | ||
abstract-par base brick containers criterion directory foldl free | ||
histogram-fill hspec ieee754 integration lens linear log-domain | ||
math-functions matrix monad-coroutine monad-extras mtl mwc-random | ||
optparse-applicative pipes pretty-simple primitive process | ||
QuickCheck random random-fu safe scientific statistics text time transformers | ||
typed-process vector vty | ||
]; | ||
testHaskellDepends = [ | ||
abstract-par base brick containers criterion directory foldl free | ||
histogram-fill hspec ieee754 integration lens linear log-domain | ||
math-functions matrix monad-coroutine monad-extras mtl mwc-random | ||
optparse-applicative pipes pretty-simple primitive process | ||
QuickCheck random random-fu safe scientific statistics text time transformers | ||
typed-process vector vty | ||
]; | ||
benchmarkHaskellDepends = [ | ||
abstract-par base brick containers criterion directory foldl free | ||
histogram-fill hspec ieee754 integration lens linear log-domain | ||
math-functions matrix monad-coroutine monad-extras mtl mwc-random | ||
optparse-applicative pipes pretty-simple primitive process | ||
QuickCheck random random-fu safe scientific statistics text time transformers | ||
typed-process vector vty | ||
]; | ||
homepage = "http://github.com/tweag/monad-bayes#readme"; | ||
description = "A library for probabilistic programming"; | ||
license = lib.licenses.mit; | ||
mainProgram = "example"; | ||
}; | ||
|
||
haskellPackages = if compiler == "default" | ||
then pkgs.haskellPackages | ||
else pkgs.haskell.packages.${compiler}; | ||
|
||
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; | ||
|
||
drv = variant (haskellPackages.callPackage f {}); | ||
|
||
in | ||
|
||
if pkgs.lib.inNixShell then drv.env else drv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters