Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake .#dev-top-level
2 changes: 1 addition & 1 deletion .github/workflows/simulation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ jobs:
- name: 🛠️ Run fourmolu
uses: haskell-actions/run-fourmolu@v11
with:
version: "0.15.0.0"
version: "0.19.0.1"
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ how something is implemented in a feature idea or bug ticket beforehand.

To build Haskell code in this repository, you need to install:

* The [GHC](https://www.haskell.org/ghc/) compiler version 9.6.3
* [cabal](https://www.haskell.org/cabal/) build tool
* The [GHC](https://www.haskell.org/ghc/) compiler version 9.10.1
* [cabal](https://www.haskell.org/cabal/) build tool version 3.12.1.0

> [!NOTE]
> Installing those tools might depend on your system's details, we suggest two different methods:
>
> * Install [GHCup](https://www.haskell.org/ghcup/) to manage various tools from the Haskell ecosystem
> * Use the provided [Nix shell](shell.nix)
> * Use the provided Nix shell by invoking `nix develop`

Running `cabal update && cabal build all` at the top-level of the
project should build all the Haskell components. Tests are run with
Expand Down
144 changes: 97 additions & 47 deletions analysis/deltaq/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,63 +18,97 @@
deltaq.flake = false;
};

outputs = {
self,
flake-compat,
flake-utils,
nixpkgs,
jupyenv,
deltaq,
...
} @ inputs:
flake-utils.lib.eachSystem (with flake-utils.lib.system; [ x86_64-linux ])
(
system: let
outputs =
{
self,
flake-utils,
nixpkgs,
jupyenv,
deltaq,
...
}:
flake-utils.lib.eachSystem (with flake-utils.lib.system; [ x86_64-linux ]) (
system:
let

overlay = next: prev: {
overlay = _next: prev: {
haskell = prev.haskell // {
packageOverrides = hnext: hprev: {
packageOverrides = _hnext: hprev: {
# Include the DeltaQ packages.
deltaq = hprev.callCabal2nixWithOptions
"deltaq"
(deltaq.outPath + "/lib/deltaq")
"--no-check"
{};
probability-polynomial = hprev.callCabal2nixWithOptions
"probability-polynomial"
(deltaq.outPath + "/lib/probability-polynomial")
"--no-check"
{};
deltaq = hprev.callCabal2nixWithOptions "deltaq" (deltaq.outPath + "/lib/deltaq") "--no-check" { };
probability-polynomial = hprev.callCabal2nixWithOptions "probability-polynomial" (
deltaq.outPath + "/lib/probability-polynomial"
) "--no-check" { };
# Use a more recent version of `lattices` than is available in the curated Nix package set.
lattices = hprev.callPackage (
{ mkDerivation, base, containers, deepseq, hashable
, integer-logarithms, lib, QuickCheck, quickcheck-instances, tagged
, tasty, tasty-quickcheck, transformers, universe-base
, universe-reverse-instances, unordered-containers
{
mkDerivation,
base,
containers,
deepseq,
hashable,
integer-logarithms,
lib,
QuickCheck,
quickcheck-instances,
tagged,
tasty,
tasty-quickcheck,
transformers,
universe-base,
universe-reverse-instances,
unordered-containers,
}:
mkDerivation {
pname = "lattices";
version = "2.2.1";
sha256 = "27063f2343b1547033cd59f61b27f797041ed0c25c921f253ce82dc6fffa7666";
libraryHaskellDepends = [
base containers deepseq hashable integer-logarithms QuickCheck
tagged transformers universe-base universe-reverse-instances
base
containers
deepseq
hashable
integer-logarithms
QuickCheck
tagged
transformers
universe-base
universe-reverse-instances
unordered-containers
];
testHaskellDepends = [
base containers QuickCheck quickcheck-instances tasty
tasty-quickcheck transformers universe-base
universe-reverse-instances unordered-containers
base
containers
QuickCheck
quickcheck-instances
tasty
tasty-quickcheck
transformers
universe-base
universe-reverse-instances
unordered-containers
];
homepage = "http://github.com/phadej/lattices/";
description = "Fine-grained library for constructing and manipulating lattices";
license = lib.licenses.bsd3;
}
) {};
) { };
# Sadly, we need to loosen the dependency constraint that `Chart-cairo` has on `time`.
Chart-cairo = hprev.callPackage (
{ mkDerivation, array, base, cairo, Chart, colour
, data-default-class, lens, lib, mtl, old-locale, operational, time
{
mkDerivation,
array,
base,
cairo,
Chart,
colour,
data-default-class,
lens,
lib,
mtl,
old-locale,
operational,
time,
}:
mkDerivation {
pname = "Chart-cairo";
Expand All @@ -84,26 +118,41 @@
sed -e '/, time/s/ >=.*$//' -i Chart-cairo.cabal
'';
libraryHaskellDepends = [
array base cairo Chart colour data-default-class lens mtl
old-locale operational time
array
base
cairo
Chart
colour
data-default-class
lens
mtl
old-locale
operational
time
];
homepage = "https://github.com/timbod7/haskell-chart/wiki";
description = "Cairo backend for Charts";
license = lib.licenses.bsd3;
}
) {};
) { };
};
};
};

pkgs = import nixpkgs { inherit system; overlays = [ overlay ]; };
pkgs = import nixpkgs {
inherit system;
overlays = [ overlay ];
};

inherit (jupyenv.lib.${system}) mkJupyterlabNew;

jupyterlab = mkJupyterlabNew ({...}: {
nixpkgs = nixpkgs;
imports = [(import ./kernels.nix {pkgs = pkgs;})];
});
jupyterlab = mkJupyterlabNew (
{ ... }:
{
inherit nixpkgs;
imports = [ (import ./kernels.nix { inherit pkgs; }) ];
}
);

docker = pkgs.dockerTools.buildImage {
name = "jupyter-deltaq";
Expand Down Expand Up @@ -146,13 +195,14 @@
"--NotebookApp.token=deltaq"
];
ExposedPorts = {
"8888" = {};
"8888" = { };
};
};
};

in rec {
packages = {inherit jupyterlab docker;};
in
rec {
packages = { inherit jupyterlab docker; };
packages.default = jupyterlab;
apps.default.program = "${jupyterlab}/bin/jupyter-lab";
apps.default.type = "app";
Expand Down
65 changes: 33 additions & 32 deletions analysis/deltaq/kernels.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{pkgs, ...}:
{ pkgs, ... }:

{

Expand All @@ -10,37 +10,38 @@
enable = true;
nixpkgs = pkgs;
haskellCompiler = "ghc94";
extraHaskellPackages = p: with p; [

# Required for charts in iHaskell kernel
ihaskell
ihaskell-charts
Chart-cairo

# Packages
deltaq
probability-polynomial

# Library dependencies
Chart
exact-combinatorics
graphviz
lattices

# Test dependencies, not strictly needed but perhaps convenient
hspec
hspec-discover
QuickCheck

# Benchmark dependencies, not strictly needed but perhaps convenient
cassava
criterion
hvega
optparse-applicative
statistics
vector

];
extraHaskellPackages =
p: with p; [

# Required for charts in iHaskell kernel
ihaskell
ihaskell-charts
Chart-cairo

# Packages
deltaq
probability-polynomial

# Library dependencies
Chart
exact-combinatorics
graphviz
lattices

# Test dependencies, not strictly needed but perhaps convenient
hspec
hspec-discover
QuickCheck

# Benchmark dependencies, not strictly needed but perhaps convenient
cassava
criterion
hvega
optparse-applicative
statistics
vector

];
};

}
4 changes: 3 additions & 1 deletion analysis/markov/shell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ pkgs ? import <nixpkgs> {} }:
{
pkgs ? import <nixpkgs> { },
}:

pkgs.mkShell {
buildInputs = with pkgs; [
Expand Down
Loading
Loading