Skip to content
Open
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
.dir-locals-2.el

# Haskell
dist-newstyle/
dist-newstyle/

# direnv
.direnv
22 changes: 0 additions & 22 deletions default.nix

This file was deleted.

36 changes: 18 additions & 18 deletions examples/examples.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ executable sudoku
default-language: Haskell2010
ghc-options: -threaded -pgmL markdown-unlit
build-depends: base <5
, containers ^>=0.6
, markdown-unlit ^>=0.5
, math-programming ^>=0.5
, math-programming-glpk ^>=0.5
, mtl ^>=2.2
, text ^>=1.2
, containers >=0.6
, markdown-unlit >=0.5
, math-programming >=0.5
, math-programming-glpk >=0.5
, mtl >=2.2
, text >=1.2

executable 3sat
main-is: Example3SAT.lhs
hs-source-dirs: app
default-language: Haskell2010
ghc-options: -threaded -pgmL markdown-unlit
build-depends: base <5
, containers ^>=0.6
, markdown-unlit ^>=0.5
, math-programming ^>=0.5
, math-programming-glpk ^>=0.5
, mtl ^>=2.2
, text ^>=1.2
, containers >=0.6
, markdown-unlit >=0.5
, math-programming >=0.5
, math-programming-glpk >=0.5
, mtl >=2.2
, text >=1.2


executable tutorial
Expand All @@ -50,9 +50,9 @@ executable tutorial
default-language: Haskell2010
ghc-options: -threaded -pgmL markdown-unlit
build-depends: base <5
, containers ^>=0.6
, markdown-unlit ^>=0.5
, math-programming ^>=0.5
, math-programming-glpk ^>=0.5
, mtl ^>=2.2
, text ^>=1.2
, containers >=0.6
, markdown-unlit >=0.5
, math-programming >=0.5
, math-programming-glpk >=0.5
, mtl >=2.2
, text >=1.2
60 changes: 60 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
description = "A collection of libraries for mathematical programming";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
haskellPackages = pkgs.haskellPackages.override {
overrides = self: super: {
examples = self.callCabal2nix "examples" ./examples {};
glpk-headers = self.callCabal2nix "glpk-headers" ./glpk-headers {};
math-programming = self.callCabal2nix "math-programming" ./math-programming {};
math-programming-glpk = self.callCabal2nix "math-programming-glpk" ./math-programming-glpk {};
math-programming-tests = self.callCabal2nix "math-programming-tests" ./math-programming-tests {};
};
};
in
{
packages.examples = haskellPackages.examples;
packages.glpk-headers = haskellPackages.glpk-headers;
packages.math-programming = haskellPackages.mathProgramming;
packages.math-programming-glpk = haskellPackages.mathProgrammingGlpk;
packages.math-programming-tests = haskellPackages.mathProgrammingTests;
packages.default = self.packages.${system}.examples;
defaultPackage = self.packages.${system}.default;
devShells.default = pkgs.haskellPackages.shellFor {
packages = p: [ haskellPackages.examples
haskellPackages.glpk-headers
haskellPackages.math-programming
haskellPackages.math-programming-glpk
haskellPackages.math-programming-tests
];
buildInputs = [
pkgs.haskellPackages.haskell-language-server
pkgs.ormolu
pkgs.cabal-install
];
withHoogle = true;
doBenchmark = true;
};
devShell = self.devShells.${system}.default;
}
);
}
18 changes: 9 additions & 9 deletions math-programming-glpk/math-programming-glpk.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ library
other-modules: Math.Programming.Glpk.Internal
ghc-options: -Wall
build-depends: base <5
, glpk-headers ^>=0.5
, math-programming ^>=0.5
, mtl ^>=2.2
, text ^>=1.2
, transformers ^>=0.5
, unliftio ^>=0.2
, glpk-headers >=0.5
, math-programming >=0.5
, mtl >=2.2
, text >=1.2
, transformers >=0.5
, unliftio >=0.2

test-suite math-programming-glpk-test-suite
default-language: Haskell2010
Expand All @@ -40,7 +40,7 @@ test-suite math-programming-glpk-test-suite
ghc-options: -threaded -with-rtsopts=-N -Wall
build-depends: math-programming-glpk
, base <5
, math-programming ^>=0.5
, math-programming-tests ^>=0.5
, unliftio ^>=0.2
, math-programming >=0.5
, math-programming-tests >=0.5
, unliftio >=0.2
, hspec >=2.8 && < 3
18 changes: 9 additions & 9 deletions math-programming-tests/math-programming-tests.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ library
other-modules:
ghc-options: -Wall
build-depends: base <5
, containers ^>=0.6
, math-programming ^>=0.5
, microlens ^>=0.4
, microlens-th ^>=0.4
, microlens-mtl ^>=0.2
, containers >=0.6
, math-programming >=0.5
, microlens >=0.4
, microlens-th >=0.4
, microlens-mtl >=0.2
, hspec >=2.8 && <3
, QuickCheck ^>=2.14
, random ^>=1.2
, mtl ^>=2.2
, text ^>=1.2
, QuickCheck >=2.14
, random >=1.2
, mtl >=2.2
, text >=1.2
16 changes: 8 additions & 8 deletions math-programming/math-programming.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ library
ghc-options: -Wall
-- Restrictions on transformers due to https://hub.darcs.net/ross/transformers/issue/90
build-depends: base <5
, containers ^>=0.6
, exceptions ^>=0.10
, mtl ^>=2.2
, text ^>=1.2
, transformers ^>=0.5
, containers >=0.6
, exceptions >=0.10
, mtl >=2.2
, text >=1.2
, transformers >=0.5

test-suite math-programming-test-suite
default-language: Haskell2010
Expand All @@ -45,6 +45,6 @@ test-suite math-programming-test-suite
build-depends: math-programming
, base <5
, hspec >=2.8 && <3
, mtl ^>=2.2
, QuickCheck ^>=2.14
, text ^>=1.2
, mtl >=2.2
, QuickCheck >=2.14
, text >=1.2
20 changes: 1 addition & 19 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
{ sources ? import ./nix/sources.nix
, pkgs ? import sources.nixpkgs { }
}:
let
local = import ./default.nix { inherit sources pkgs; };
in
pkgs.haskellPackages.shellFor {
packages = p: [ local.examples
local.glpk-headers
local.math-programming
local.math-programming-glpk
local.math-programming-tests
];
buildInputs = [ pkgs.cabal-install
pkgs.cabal2nix
pkgs.haskell-language-server
];
withHoogle = true;
}
(builtins.getFlake (builtins.toString ./.)).outputs.devShells.${builtins.currentSystem}