From 509f37203b4d2a899b50b7f4ab0f1ad1670e1a39 Mon Sep 17 00:00:00 2001 From: Vaibhav Sagar Date: Fri, 5 Jul 2024 15:35:42 +1000 Subject: [PATCH] Update notebooks for GHC 9.6 --- callcc/default.nix | 11 +- chart-diagrams/default.nix | 11 +- codensity/default.nix | 11 +- continuations/default.nix | 11 +- deriving-via/default.nix | 11 +- docker/default.nix | 11 +- dragon-curve/default.nix | 11 +- efficient-combinator-parsers/default.nix | 11 +- flake.lock | 14 +- flake.nix | 2 +- git-from-scratch/default.nix | 11 +- graphviz/default.nix | 11 +- hamt/HAMTVisualisation.ipynb | 4 +- hamt/HashArrayMappedTrieProgression.ipynb | 876 +++++++++--------- hamt/default.nix | 11 +- higher-kinded-data/default.nix | 11 +- hs-updater/default.nix | 12 +- intmap/default.nix | 11 +- lambda/default.nix | 11 +- mph/MPH.ipynb | 103 +- mph/Untitled.ipynb | 481 +++++++++- mph/default.nix | 11 +- refactoring-tarjan/default.nix | 11 +- .../default.nix | 11 +- revisiting-poor-mans-concurrency/default.nix | 11 +- smt/default.nix | 7 +- solver/default.nix | 11 +- tarjan/default.nix | 11 +- trees-that-shrink/default.nix | 11 +- typeclasses/default.nix | 11 +- zulip-api/default.nix | 12 +- 31 files changed, 1048 insertions(+), 705 deletions(-) diff --git a/callcc/default.nix b/callcc/default.nix index f0cabfa..c2114c8 100644 --- a/callcc/default.nix +++ b/callcc/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [jupyterlab]; packages = self: with self; []; } diff --git a/chart-diagrams/default.nix b/chart-diagrams/default.nix index d8f71b9..91986b4 100644 --- a/chart-diagrams/default.nix +++ b/chart-diagrams/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [jupyterlab]; packages = self: with self; [ ihaskell-aeson ihaskell-blaze ihaskell-charts ihaskell-diagrams ]; systemPackages = self: with self; [ graphviz ]; diff --git a/codensity/default.nix b/codensity/default.nix index f0cabfa..c2114c8 100644 --- a/codensity/default.nix +++ b/codensity/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [jupyterlab]; packages = self: with self; []; } diff --git a/continuations/default.nix b/continuations/default.nix index f0cabfa..c2114c8 100644 --- a/continuations/default.nix +++ b/continuations/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [jupyterlab]; packages = self: with self; []; } diff --git a/deriving-via/default.nix b/deriving-via/default.nix index f0cabfa..c2114c8 100644 --- a/deriving-via/default.nix +++ b/deriving-via/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [jupyterlab]; packages = self: with self; []; } diff --git a/docker/default.nix b/docker/default.nix index ae12606..a219096 100644 --- a/docker/default.nix +++ b/docker/default.nix @@ -3,15 +3,6 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); @@ -30,7 +21,7 @@ let echo "root:x::" > $out/etc/gshadow echo "jovyan:!::" >> $out/etc/gshadow ''; - ihaskell = nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ + ihaskell = nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ packages = self: with self; []; extraEnvironmentBinaries = [jupyterlab]; staticExecutable = true; diff --git a/dragon-curve/default.nix b/dragon-curve/default.nix index f0cabfa..c2114c8 100644 --- a/dragon-curve/default.nix +++ b/dragon-curve/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [jupyterlab]; packages = self: with self; []; } diff --git a/efficient-combinator-parsers/default.nix b/efficient-combinator-parsers/default.nix index b643de1..589ec63 100644 --- a/efficient-combinator-parsers/default.nix +++ b/efficient-combinator-parsers/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [jupyterlab]; packages = self: with self; [ timeit ]; } diff --git a/flake.lock b/flake.lock index f7afdd2..5122abf 100644 --- a/flake.lock +++ b/flake.lock @@ -36,11 +36,11 @@ "ihaskell": { "flake": false, "locked": { - "lastModified": 1713701300, - "narHash": "sha256-x3/hUQe5dmOiIBgvoqwpJj2F3kK9teciNawhknjda+o=", + "lastModified": 1719749203, + "narHash": "sha256-ADtPNRm2uNMJsOHnj4srdv6/+N3LS4NNEAIAUEeueqk=", "owner": "IHaskell", "repo": "IHaskell", - "rev": "b223a6c2d0d0e812c4d77c062cc82ac7df8f8eca", + "rev": "2b1ad9979a82fdb23942f6f46753c471562975bf", "type": "github" }, "original": { @@ -66,16 +66,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1713798656, - "narHash": "sha256-3LFtKTsysGQrocHTFUnb1zQHPX0ffyze144YPW7bafk=", + "lastModified": 1720137366, + "narHash": "sha256-Xn+WAX2t2yjNdgZEyEtjCLvkqjrGPVhKRGsM6ujUf8c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a69432f36a048fa40f192244a9bca949f271a3c2", + "rev": "f2a40608e6b55661cac28e473e28b6208da53c01", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-23.11", + "ref": "release-24.05", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 6ca1ad9..f1ee1e4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-23.11"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-24.05"; inputs.flake-utils.url = "github:numtide/flake-utils"; inputs.nix-filter.url = "github:numtide/nix-filter"; inputs.ihaskell.url = "github:IHaskell/IHaskell"; diff --git a/git-from-scratch/default.nix b/git-from-scratch/default.nix index 97740e8..2f915ca 100644 --- a/git-from-scratch/default.nix +++ b/git-from-scratch/default.nix @@ -3,15 +3,6 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); @@ -31,7 +22,7 @@ let ); git-from-scratch = nixpkgs.haskellPackages.callCabal2nix "git-from-scratch" (builtins.filterSource cleanSource ./.) {}; -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ packages = self: with self; [ SHA attoparsec diff --git a/graphviz/default.nix b/graphviz/default.nix index 7681a5c..82d5a62 100644 --- a/graphviz/default.nix +++ b/graphviz/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [ jupyterlab ]; packages = self: with self; [ here ihaskell-graphviz ]; systemPackages = self: with self; [ graphviz ]; diff --git a/hamt/HAMTVisualisation.ipynb b/hamt/HAMTVisualisation.ipynb index 89f02e9..5efa32b 100644 --- a/hamt/HAMTVisualisation.ipynb +++ b/hamt/HAMTVisualisation.ipynb @@ -1077,9 +1077,9 @@ "mimetype": "text/x-haskell", "name": "haskell", "pygments_lexer": "Haskell", - "version": "9.2.8" + "version": "9.4.8" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/hamt/HashArrayMappedTrieProgression.ipynb b/hamt/HashArrayMappedTrieProgression.ipynb index cf44571..8cdc72d 100644 --- a/hamt/HashArrayMappedTrieProgression.ipynb +++ b/hamt/HashArrayMappedTrieProgression.ipynb @@ -308,246 +308,246 @@ "\n", "\n", - "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", "n4\n", - "\n", - "00000000000000000000000000000000\n", - "\n", - "0\n", - "\n", - "1\n", + "\n", + "00000000000000000000000000000000\n", + "\n", + "0\n", + "\n", + "1\n", "\n", "\n", "\n", "n5\n", - "\n", - "00000000000000000000000000001000\n", - "\n", - "8\n", - "\n", - "34\n", + "\n", + "00000000000000000000000000001000\n", + "\n", + "8\n", + "\n", + "34\n", "\n", "\n", "\n", "n3\n", - "\n", - " \n", + "\n", + " \n", "\n", "\n", "\n", "n3->n4\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n3->n5\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n6\n", - "\n", - "00000000000000000000000000000100\n", - "\n", - "4\n", - "\n", - "5\n", + "\n", + "00000000000000000000000000000100\n", + "\n", + "4\n", + "\n", + "5\n", "\n", "\n", "\n", "n2\n", - "\n", - " \n", + "\n", + " \n", "\n", "\n", "\n", "n2->n3\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n2->n6\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n8\n", - "\n", - "00000000000000000000000000000010\n", - "\n", - "2\n", - "\n", - "2\n", + "\n", + "00000000000000000000000000000010\n", + "\n", + "2\n", + "\n", + "2\n", "\n", "\n", "\n", "n9\n", - "\n", - "00000000000000000000000000000110\n", - "\n", - "6\n", - "\n", - "13\n", + "\n", + "00000000000000000000000000000110\n", + "\n", + "6\n", + "\n", + "13\n", "\n", "\n", "\n", "n7\n", - "\n", - " \n", + "\n", + " \n", "\n", "\n", "\n", "n7->n8\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n7->n9\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n1\n", - "\n", - " \n", + "\n", + " \n", "\n", "\n", "\n", "n1->n2\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n1->n7\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n12\n", - "\n", - "00000000000000000000000000000001\n", - "\n", - "1\n", - "\n", - "1\n", + "\n", + "00000000000000000000000000000001\n", + "\n", + "1\n", + "\n", + "1\n", "\n", "\n", "\n", "n13\n", - "\n", - "00000000000000000000000000000101\n", - "\n", - "5\n", - "\n", - "8\n", + "\n", + "00000000000000000000000000000101\n", + "\n", + "5\n", + "\n", + "8\n", "\n", "\n", "\n", "n11\n", - "\n", - " \n", + "\n", + " \n", "\n", "\n", "\n", "n11->n12\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n11->n13\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n15\n", - "\n", - "00000000000000000000000000000011\n", - "\n", - "3\n", - "\n", - "3\n", + "\n", + "00000000000000000000000000000011\n", + "\n", + "3\n", + "\n", + "3\n", "\n", "\n", "\n", "n16\n", - "\n", - "00000000000000000000000000000111\n", - "\n", - "7\n", - "\n", - "21\n", + "\n", + "00000000000000000000000000000111\n", + "\n", + "7\n", + "\n", + "21\n", "\n", "\n", "\n", "n14\n", - "\n", - " \n", + "\n", + " \n", "\n", "\n", "\n", "n14->n15\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n14->n16\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n10\n", - "\n", - " \n", + "\n", + " \n", "\n", "\n", "\n", "n10->n11\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n10->n14\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0\n", - "\n", - " \n", + "\n", + " \n", "\n", "\n", "\n", "n0->n1\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0->n10\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n" @@ -712,262 +712,262 @@ "\n", "\n", - "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", "n4\n", - "\n", - "00000000000000000000000000000000\n", - "\n", - "0\n", - "\n", - "1\n", + "\n", + "00000000000000000000000000000000\n", + "\n", + "0\n", + "\n", + "1\n", "\n", "\n", "\n", "n5\n", - "\n", - "00000000000000000000000000001000\n", - "\n", - "8\n", - "\n", - "34\n", + "\n", + "00000000000000000000000000001000\n", + "\n", + "8\n", + "\n", + "34\n", "\n", "\n", "\n", "n3\n", - "\n", - " \n", - "\n", - " \n", + "\n", + " \n", + "\n", + " \n", "\n", "\n", "\n", "n3:f0->n4\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n3:f1->n5\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n6\n", - "\n", - "00000000000000000000000000000100\n", - "\n", - "4\n", - "\n", - "5\n", + "\n", + "00000000000000000000000000000100\n", + "\n", + "4\n", + "\n", + "5\n", "\n", "\n", "\n", "n2\n", - "\n", - " \n", - "\n", - " \n", + "\n", + " \n", + "\n", + " \n", "\n", "\n", "\n", "n2:f0->n3\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n2:f1->n6\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n8\n", - "\n", - "00000000000000000000000000000010\n", - "\n", - "2\n", - "\n", - "2\n", + "\n", + "00000000000000000000000000000010\n", + "\n", + "2\n", + "\n", + "2\n", "\n", "\n", "\n", "n9\n", - "\n", - "00000000000000000000000000000110\n", - "\n", - "6\n", - "\n", - "13\n", + "\n", + "00000000000000000000000000000110\n", + "\n", + "6\n", + "\n", + "13\n", "\n", "\n", "\n", "n7\n", - "\n", - " \n", - "\n", - " \n", + "\n", + " \n", + "\n", + " \n", "\n", "\n", "\n", "n7:f0->n8\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n7:f1->n9\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n1\n", - "\n", - " \n", - "\n", - " \n", + "\n", + " \n", + "\n", + " \n", "\n", "\n", "\n", "n1:f0->n2\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n1:f1->n7\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n12\n", - "\n", - "00000000000000000000000000000001\n", - "\n", - "1\n", - "\n", - "1\n", + "\n", + "00000000000000000000000000000001\n", + "\n", + "1\n", + "\n", + "1\n", "\n", "\n", "\n", "n13\n", - "\n", - "00000000000000000000000000000101\n", - "\n", - "5\n", - "\n", - "8\n", + "\n", + "00000000000000000000000000000101\n", + "\n", + "5\n", + "\n", + "8\n", "\n", "\n", "\n", "n11\n", - "\n", - " \n", - "\n", - " \n", + "\n", + " \n", + "\n", + " \n", "\n", "\n", "\n", "n11:f0->n12\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n11:f1->n13\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n15\n", - "\n", - "00000000000000000000000000000011\n", - "\n", - "3\n", - "\n", - "3\n", + "\n", + "00000000000000000000000000000011\n", + "\n", + "3\n", + "\n", + "3\n", "\n", "\n", "\n", "n16\n", - "\n", - "00000000000000000000000000000111\n", - "\n", - "7\n", - "\n", - "21\n", + "\n", + "00000000000000000000000000000111\n", + "\n", + "7\n", + "\n", + "21\n", "\n", "\n", "\n", "n14\n", - "\n", - " \n", - "\n", - " \n", + "\n", + " \n", + "\n", + " \n", "\n", "\n", "\n", "n14:f0->n15\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n14:f1->n16\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n10\n", - "\n", - " \n", - "\n", - " \n", + "\n", + " \n", + "\n", + " \n", "\n", "\n", "\n", "n10:f0->n11\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n10:f1->n14\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0\n", - "\n", - " \n", - "\n", - " \n", + "\n", + " \n", + "\n", + " \n", "\n", "\n", "\n", "n0:f0->n1\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f1->n10\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n" @@ -1144,192 +1144,192 @@ "\n", "\n", - "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", "n1\n", - "\n", - "00000000000000000000000000000000\n", - "\n", - "0\n", - "\n", - "1\n", + "\n", + "00000000000000000000000000000000\n", + "\n", + "0\n", + "\n", + "1\n", "\n", "\n", "\n", "n2\n", - "\n", - "00000000000000000000000000000001\n", - "\n", - "1\n", - "\n", - "1\n", + "\n", + "00000000000000000000000000000001\n", + "\n", + "1\n", + "\n", + "1\n", "\n", "\n", "\n", "n3\n", - "\n", - "00000000000000000000000000000010\n", - "\n", - "2\n", - "\n", - "2\n", + "\n", + "00000000000000000000000000000010\n", + "\n", + "2\n", + "\n", + "2\n", "\n", "\n", "\n", "n4\n", - "\n", - "00000000000000000000000000000011\n", - "\n", - "3\n", - "\n", - "3\n", + "\n", + "00000000000000000000000000000011\n", + "\n", + "3\n", + "\n", + "3\n", "\n", "\n", "\n", "n5\n", - "\n", - "00000000000000000000000000000100\n", - "\n", - "4\n", - "\n", - "5\n", + "\n", + "00000000000000000000000000000100\n", + "\n", + "4\n", + "\n", + "5\n", "\n", "\n", "\n", "n6\n", - "\n", - "00000000000000000000000000000101\n", - "\n", - "5\n", - "\n", - "8\n", + "\n", + "00000000000000000000000000000101\n", + "\n", + "5\n", + "\n", + "8\n", "\n", "\n", "\n", "n7\n", - "\n", - "00000000000000000000000000000110\n", - "\n", - "6\n", - "\n", - "13\n", + "\n", + "00000000000000000000000000000110\n", + "\n", + "6\n", + "\n", + "13\n", "\n", "\n", "\n", "n8\n", - "\n", - "00000000000000000000000000000111\n", - "\n", - "7\n", - "\n", - "21\n", + "\n", + "00000000000000000000000000000111\n", + "\n", + "7\n", + "\n", + "21\n", "\n", "\n", "\n", "n9\n", - "\n", - "00000000000000000000000000001000\n", + "\n", + "00000000000000000000000000001000\n", + "\n", + "8\n", "\n", - "8\n", - "\n", - "34\n", + "34\n", "\n", "\n", "\n", "n0\n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", "\n", "\n", "\n", "n0:f0->n1\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f1->n2\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f2->n3\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f3->n4\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f4->n5\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f5->n6\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f6->n7\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f7->n8\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f8->n9\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n" @@ -1345,7 +1345,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 31, "id": "documentary-assurance", "metadata": { "scrolled": false @@ -1361,7 +1361,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 32, "id": "governing-ebony", "metadata": {}, "outputs": [], @@ -1371,7 +1371,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 33, "id": "worse-turner", "metadata": {}, "outputs": [], @@ -1409,7 +1409,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 34, "id": "peripheral-romania", "metadata": {}, "outputs": [], @@ -1434,7 +1434,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 35, "id": "endangered-intellectual", "metadata": {}, "outputs": [], @@ -1447,7 +1447,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 36, "id": "prime-meeting", "metadata": {}, "outputs": [], @@ -1500,7 +1500,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 37, "id": "095bc5b7", "metadata": {}, "outputs": [ @@ -1510,180 +1510,180 @@ "\n", "\n", - "\n", "\n", - "\n", + "\n", "\n", - "\n", + "\n", "\n", "\n", "n1\n", - "\n", - "00000000000000000000000000000000\n", - "\n", - "0\n", - "\n", - "1\n", + "\n", + "00000000000000000000000000000000\n", + "\n", + "0\n", + "\n", + "1\n", "\n", "\n", "\n", "n2\n", - "\n", - "00000000000000000000000000000001\n", - "\n", - "1\n", - "\n", - "1\n", + "\n", + "00000000000000000000000000000001\n", + "\n", + "1\n", + "\n", + "1\n", "\n", "\n", "\n", "n3\n", - "\n", - "00000000000000000000000000000010\n", - "\n", - "2\n", - "\n", - "2\n", + "\n", + "00000000000000000000000000000010\n", + "\n", + "2\n", + "\n", + "2\n", "\n", "\n", "\n", "n4\n", - "\n", - "00000000000000000000000000000011\n", - "\n", - "3\n", - "\n", - "3\n", + "\n", + "00000000000000000000000000000011\n", + "\n", + "3\n", + "\n", + "3\n", "\n", "\n", "\n", "n5\n", - "\n", - "00000000000000000000000000000100\n", - "\n", - "4\n", - "\n", - "5\n", + "\n", + "00000000000000000000000000000100\n", + "\n", + "4\n", + "\n", + "5\n", "\n", "\n", "\n", "n6\n", - "\n", - "00000000000000000000000000000101\n", - "\n", - "5\n", - "\n", - "8\n", + "\n", + "00000000000000000000000000000101\n", + "\n", + "5\n", + "\n", + "8\n", "\n", "\n", "\n", "n7\n", - "\n", - "00000000000000000000000000000110\n", - "\n", - "6\n", - "\n", - "13\n", + "\n", + "00000000000000000000000000000110\n", + "\n", + "6\n", + "\n", + "13\n", "\n", "\n", "\n", "n8\n", - "\n", - "00000000000000000000000000000111\n", - "\n", - "7\n", - "\n", - "21\n", + "\n", + "00000000000000000000000000000111\n", + "\n", + "7\n", + "\n", + "21\n", "\n", "\n", "\n", "n9\n", - "\n", - "00000000000000000000000000001000\n", + "\n", + "00000000000000000000000000001000\n", + "\n", + "8\n", "\n", - "8\n", - "\n", - "34\n", + "34\n", "\n", "\n", "\n", "n0\n", - "\n", - "0000000111111111\n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", - "\n", - " \n", + "\n", + "0000000111111111\n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", "\n", "\n", "\n", "n0:f0->n1\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f1->n2\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f2->n3\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f3->n4\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f4->n5\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f5->n6\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f6->n7\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f7->n8\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n", "n0:f8->n9\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", "\n" @@ -1710,7 +1710,7 @@ "mimetype": "text/x-haskell", "name": "haskell", "pygments_lexer": "Haskell", - "version": "9.2.8" + "version": "9.4.8" } }, "nbformat": 4, diff --git a/hamt/default.nix b/hamt/default.nix index 6d79abb..c1595f4 100644 --- a/hamt/default.nix +++ b/hamt/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [jupyterlab]; packages = self: with self; [ bytestring memory pretty-show timeit vector here ihaskell-graphviz ]; systemPackages = self: with self; [ graphviz ]; diff --git a/higher-kinded-data/default.nix b/higher-kinded-data/default.nix index 191b9c1..60f4446 100644 --- a/higher-kinded-data/default.nix +++ b/higher-kinded-data/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [ jupyterlab ]; packages = self: with self; [ validation ]; } diff --git a/hs-updater/default.nix b/hs-updater/default.nix index c6cec91..59166e4 100644 --- a/hs-updater/default.nix +++ b/hs-updater/default.nix @@ -3,20 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - sbv = sup.haskell.lib.dontCheck (self.callHackage "sbv" "10.1" {}); - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [ jupyterlab ]; packages = self: with self; [ aeson diff --git a/intmap/default.nix b/intmap/default.nix index 04f7e80..96347c3 100644 --- a/intmap/default.nix +++ b/intmap/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [ jupyterlab ]; packages = self: with self; [ pretty-show ]; } diff --git a/lambda/default.nix b/lambda/default.nix index 288545d..67e6a75 100644 --- a/lambda/default.nix +++ b/lambda/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ packages = self: with self; [ containers transformers vector ]; extraEnvironmentBinaries = [jupyterlab]; } diff --git a/mph/MPH.ipynb b/mph/MPH.ipynb index cc42be1..389a75e 100644 --- a/mph/MPH.ipynb +++ b/mph/MPH.ipynb @@ -193,11 +193,108 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "4f555266-b241-44c1-9c38-b57412c2416b", "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "[[1,0,0],[1,1]]" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "toBitArray :: BitVector -> [Int]\n", + "toBitArray arr = let\n", + " bits = toBits arr\n", + " in map (\\b -> if b then 1 else 0) bits\n", + " \n", + "V.map toBitArray $ mphBitVectors mph" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0326fcfc-d596-4870-a19f-6d5dab4c79b5", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[[1,1,0,0,0,0,1,0,1],[0,0,0],[1,1,0]]" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "Nothing" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "beaches = HM.fromList\n", + " [ (\"Bondi\", 1)\n", + " , (\"Tamarama\", 0)\n", + " , (\"Bronte\", 0)\n", + " , (\"Clovelly\", 0)\n", + " , (\"Gordons Bay\", 0)\n", + " , (\"Coogee\", 1)\n", + " ]\n", + "\n", + "(mph, values) = generate beaches 25 1.5\n", + "V.map toBitArray $ mphBitVectors mph\n", + "mphLeftovers mph" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9fb661cf-24ac-416f-adc4-a6d23d2c6a79", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "rank (mphBitVectors mph V.! 2) 0" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "59cac11e-e63b-4544-92ee-13591d713f3e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "hashWithSalt 0 \"Shelly\" `mod` 9" + ] } ], "metadata": { diff --git a/mph/Untitled.ipynb b/mph/Untitled.ipynb index 663a012..cf238bf 100644 --- a/mph/Untitled.ipynb +++ b/mph/Untitled.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -14,9 +14,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + " ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ \n", + "┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐\n", + "│0│1│3│4│5│2│4│5│2│4│5│2│\n", + "└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "formatArray arr = let\n", " l = length arr\n", @@ -32,9 +45,130 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + " ╭────────────────────────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ ╭──────────────────────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ ╭────────────────────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ │ ╭──────────────────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ │ │ ╭────────────────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ │ │ │ ╭──────────────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ │ │ │ │ ╭────────────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ │ │ │ │ │ ╭──────────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ │ │ │ │ │ │ ╭────────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ │ │ │ │ │ │ │ ╭──────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ │ │ │ │ │ │ │ │ ╭────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ │ │ │ │ │ │ │ │ │ ╭──" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ \n", + "┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐\n", + "│0│1│3│4│5│2│4│5│2│4│5│2│\n", + "└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "drawArrows len level = let\n", " ls = len - level\n", @@ -66,11 +200,342 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ - "Map.fromAscListWith (++) $ sortOn fst $ zip (map (\\k -> hashWithSalt 0 k `mod` 6) keys) (map (:[]) keys)" + "formatArrayVertical arr ann = let\n", + " boxed = intersperse \"├─┤\" $ zipWith (\\e an -> \"│\" ++ [e] ++ \"│\" ++ \" <- \" ++ show an) arr ann\n", + " in unlines $ [\"┌─┐\"] ++ boxed ++ [\"└─┘\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "┌─┐\n", + "│1│ <- [\"Bronte\"]\n", + "├─┤\n", + "│1│ <- [\"Gordons Bay\"]\n", + "├─┤\n", + "│0│ <- []\n", + "├─┤\n", + "│0│ <- []\n", + "├─┤\n", + "│0│ <- [\"Coogee\",\"Tamarama\"]\n", + "├─┤\n", + "│0│ <- []\n", + "├─┤\n", + "│1│ <- [\"Clovelly\"]\n", + "├─┤\n", + "│0│ <- []\n", + "├─┤\n", + "│1│ <- [\"Bondi\"]\n", + "└─┘" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "displayLevel :: Hashable a => Int -> Double -> [a] -> (String, [[a]])\n", + "displayLevel i gamma keys = let\n", + " size = floor $ fromIntegral (length keys) * gamma\n", + " level = Map.fromAscListWith (++) $ sortOn fst $ zip (map (\\k -> hashWithSalt i k `mod` size) keys) (map (:[]) keys)\n", + " levelAnn = map (\\i -> Map.findWithDefault [] i level) [0..(size - 1)]\n", + " levelArr = map (\\list -> if length list /= 1 then '0' else '1') levelAnn\n", + " in (levelArr, levelAnn)\n", + "\n", + "putStrLn $ uncurry formatArrayVertical $ displayLevel\n", + " 0\n", + " 1.5\n", + " [ \"Bondi\"\n", + " , \"Tamarama\"\n", + " , \"Bronte\"\n", + " , \"Clovelly\"\n", + " , \"Gordons Bay\"\n", + " , \"Coogee\"\n", + " ]" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "┌─┐\n", + "│0│ <- [\"Coogee\",\"Tamarama\"]\n", + "├─┤\n", + "│0│ <- []\n", + "├─┤\n", + "│0│ <- []\n", + "└─┘" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "putStrLn $ uncurry formatArrayVertical $ displayLevel\n", + " 1\n", + " 1.5\n", + " [ \"Tamarama\"\n", + " , \"Coogee\"\n", + " ]" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "┌─┐\n", + "│1│ <- [\"Tamarama\"]\n", + "├─┤\n", + "│1│ <- [\"Coogee\"]\n", + "├─┤\n", + "│0│ <- []\n", + "└─┘" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "putStrLn $ uncurry formatArrayVertical $ displayLevel\n", + " 2\n", + " 1.5\n", + " [ \"Tamarama\"\n", + " , \"Coogee\"\n", + " ]" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "┌─┐\n", + "│0│ <- []\n", + "├─┤\n", + "│0│ <- [\"Coogee\",\"Clovelly\",\"Bronte\",\"Tamarama\"]\n", + "├─┤\n", + "│0│ <- []\n", + "├─┤\n", + "│0│ <- []\n", + "└─┘" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "putStrLn $ uncurry formatArrayVertical $ displayLevel\n", + " 3\n", + " 1\n", + " [ \"Tamarama\"\n", + " , \"Bronte\"\n", + " , \"Clovelly\"\n", + " , \"Coogee\"\n", + " ]" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "┌─┐\n", + "│0│ <- []\n", + "├─┤\n", + "│0│ <- []\n", + "├─┤\n", + "│0│ <- [\"Coogee\",\"Clovelly\",\"Bronte\",\"Tamarama\"]\n", + "├─┤\n", + "│0│ <- []\n", + "└─┘" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "putStrLn $ uncurry formatArrayVertical $ displayLevel\n", + " 4\n", + " [ \"Tamarama\"\n", + " , \"Bronte\"\n", + " , \"Clovelly\"\n", + " , \"Coogee\"\n", + " ]" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "┌─┐\n", + "│0│ <- []\n", + "├─┤\n", + "│0│ <- []\n", + "├─┤\n", + "│0│ <- []\n", + "├─┤\n", + "│0│ <- [\"Coogee\",\"Clovelly\",\"Bronte\",\"Tamarama\"]\n", + "└─┘" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "putStrLn $ uncurry formatArrayVertical $ displayLevel\n", + " 5\n", + " [ \"Tamarama\"\n", + " , \"Bronte\"\n", + " , \"Clovelly\"\n", + " , \"Coogee\"\n", + " ]" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "┌─┐\n", + "│0│ <- [\"Coogee\",\"Clovelly\",\"Bronte\",\"Tamarama\"]\n", + "├─┤\n", + "│0│ <- []\n", + "├─┤\n", + "│0│ <- []\n", + "├─┤\n", + "│0│ <- []\n", + "└─┘" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "putStrLn $ uncurry formatArrayVertical $ displayLevel\n", + " 6\n", + " [ \"Tamarama\"\n", + " , \"Bronte\"\n", + " , \"Clovelly\"\n", + " , \"Coogee\"\n", + " ]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + " ╭────────────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ ╭──────────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ ╭────────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ │ ╭──────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ │ │ ╭────" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " │ │ │ │ │ ╭──" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + " ↓ ↓ ↓ ↓ ↓ ↓ \n", + "┌─┬─┬─┬─┬─┬─┐\n", + "│0│0│0│0│0│0│\n", + "└─┴─┴─┴─┴─┴─┘" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "putStrLn $ drawArrows 6 6\n", + "putStrLn $ drawArrows 6 5\n", + "putStrLn $ drawArrows 6 4\n", + "putStrLn $ drawArrows 6 3\n", + "putStrLn $ drawArrows 6 2\n", + "putStrLn $ drawArrows 6 1\n", + "putStrLn $ formatArray [0, 0, 0, 0, 0, 0]" ] } ], @@ -86,7 +551,7 @@ "mimetype": "text/x-haskell", "name": "haskell", "pygments_lexer": "Haskell", - "version": "8.6.5" + "version": "9.4.8" } }, "nbformat": 4, diff --git a/mph/default.nix b/mph/default.nix index 99085c0..1ed1c0e 100644 --- a/mph/default.nix +++ b/mph/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; config.allowBroken = true; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [ jupyterlab ]; packages = self: with self; [ bv-little unordered-containers ]; } diff --git a/refactoring-tarjan/default.nix b/refactoring-tarjan/default.nix index f89004c..47ba50a 100644 --- a/refactoring-tarjan/default.nix +++ b/refactoring-tarjan/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [jupyterlab]; packages = self: with self; [ containers transformers vector ]; } diff --git a/revisiting-monadic-parsing-haskell/default.nix b/revisiting-monadic-parsing-haskell/default.nix index 0bb8fb2..cf5374c 100644 --- a/revisiting-monadic-parsing-haskell/default.nix +++ b/revisiting-monadic-parsing-haskell/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [jupyterlab]; packages = self: with self; [ transformers ]; } diff --git a/revisiting-poor-mans-concurrency/default.nix b/revisiting-poor-mans-concurrency/default.nix index fd36096..596f868 100644 --- a/revisiting-poor-mans-concurrency/default.nix +++ b/revisiting-poor-mans-concurrency/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ packages = self: with self; [ transformers ]; extraEnvironmentBinaries = [jupyterlab]; } diff --git a/smt/default.nix b/smt/default.nix index 25b4a1a..e756430 100644 --- a/smt/default.nix +++ b/smt/default.nix @@ -5,10 +5,9 @@ let nix-filter = import pkgs.nix-filter; haskell = sup.haskell // { packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { + ghc96 = sup.haskell.packages.ghc96.override { overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - sbv = sup.haskell.lib.dontCheck (self.callHackage "sbv" "10.1" {}); + sbv = sup.haskell.lib.dontCheck (self.callHackage "sbv" "10.2" {}); }; }; }; @@ -16,7 +15,7 @@ let }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [jupyterlab]; packages = self: with self; [ sbv ]; systemPackages = self: with self; [ z3 ]; diff --git a/solver/default.nix b/solver/default.nix index 972ff22..be01ea4 100644 --- a/solver/default.nix +++ b/solver/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [ jupyterlab ]; packages = self: with self; [ ]; } diff --git a/tarjan/default.nix b/tarjan/default.nix index 20da2ba..997b201 100644 --- a/tarjan/default.nix +++ b/tarjan/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [jupyterlab]; packages = self: with self; [ containers transformers vector ]; systemPackages = self: with self; [ graphviz ]; diff --git a/trees-that-shrink/default.nix b/trees-that-shrink/default.nix index 468d3bc..0c8c56f 100644 --- a/trees-that-shrink/default.nix +++ b/trees-that-shrink/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ packages = self: with self; [ containers ]; extraEnvironmentBinaries = [jupyterlab]; } diff --git a/typeclasses/default.nix b/typeclasses/default.nix index b004c1b..ed28421 100644 --- a/typeclasses/default.nix +++ b/typeclasses/default.nix @@ -3,19 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ];}); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [ jupyterlab ]; packages = self: with self; [ transformers ]; } diff --git a/zulip-api/default.nix b/zulip-api/default.nix index ea01889..34fc268 100644 --- a/zulip-api/default.nix +++ b/zulip-api/default.nix @@ -3,20 +3,10 @@ let pkgs = import ../pkgs.nix; overlay = sel: sup: { nix-filter = import pkgs.nix-filter; - haskell = sup.haskell // { - packages = sup.haskell.packages // { - ghc948 = sup.haskell.packages.ghc948.override { - overrides = self: super: { - ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_10_0; - sbv = sup.haskell.lib.dontCheck (self.callHackage "sbv" "10.1" {}); - }; - }; - }; - }; }; nixpkgs = (import pkgs.nixpkgs { inherit system; overlays = [ overlay ]; }); jupyterlab = nixpkgs.python3.withPackages (ps: [ ps.jupyterlab ps.notebook ]); -in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc948"; }{ +in nixpkgs.callPackage "${pkgs.ihaskell}/nix/release.nix" { compiler = "ghc96"; }{ extraEnvironmentBinaries = [ jupyterlab ]; packages = self: with self; [ aeson