From a498ee12d170e1b263ad4e306691a9c587788f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Thu, 9 Feb 2023 16:26:14 +0100 Subject: [PATCH 1/4] Do not gitignore flake.lock --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 05bb778a..930cd839 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ docs/build *.eventlog *.hi *.hp -*.lock +stack.yaml.lock .vscode/* *.o *.prof From e4834401568dba72cdb4102d72824d25096b01cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Thu, 9 Feb 2023 16:33:14 +0100 Subject: [PATCH 2/4] Unify transitive flake inputs --- flake.lock | 308 ++++++++--------------------------------------------- flake.nix | 25 +++-- 2 files changed, 63 insertions(+), 270 deletions(-) diff --git a/flake.lock b/flake.lock index a107b0c0..6d88fed1 100644 --- a/flake.lock +++ b/flake.lock @@ -167,11 +167,11 @@ "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "lastModified": 1627913399, + "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", "type": "github" }, "original": { @@ -198,11 +198,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "owner": "numtide", "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "type": "github" }, "original": { @@ -228,11 +228,11 @@ }, "flake-utils_3": { "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "lastModified": 1631561581, + "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", "owner": "numtide", "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", "type": "github" }, "original": { @@ -520,53 +520,44 @@ }, "ihaskell": { "inputs": { - "flake-compat": [ - "jupyterWith", - "flake-compat" - ], - "flake-utils": [ - "jupyterWith", - "flake-utils" - ], + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_3", "hls": "hls", - "nixpkgs": [ - "jupyterWith", - "nixpkgs" - ] + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1668371230, - "narHash": "sha256-yGqXQj+swFEgOFa2CJn9oW/syFuMzZF9pyDQfxOYgT4=", - "owner": "ihaskell", - "repo": "ihaskell", - "rev": "465fded2f705cedbc791d210508ca9febc04a208", + "lastModified": 1665351472, + "narHash": "sha256-+gb735LCgBaiEG9WhjDbzsgwAI2oCRJZvbdVVCYYDzQ=", + "owner": "gibiansky", + "repo": "IHaskell", + "rev": "725d900414462da0f1859334a482e80c7a9e33d9", "type": "github" }, "original": { - "owner": "ihaskell", - "repo": "ihaskell", + "owner": "gibiansky", + "repo": "IHaskell", "type": "github" } }, "jupyterWith": { "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_3", + "flake-compat": [ + "flake-compat" + ], + "flake-utils": [ + "flake-utils" + ], "ihaskell": "ihaskell", - "nixpkgs": "nixpkgs_3", - "nixpkgs-stable": "nixpkgs-stable", - "npmlock2nix": "npmlock2nix", - "opam-nix": "opam-nix", - "poetry2nix": "poetry2nix", - "pre-commit-hooks": "pre-commit-hooks_2", - "rust-overlay": "rust-overlay" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1669670331, - "narHash": "sha256-4RcNPTC125OgiFl+p7BBvpTFJhy4t6zE6rXFSKpYvyQ=", + "lastModified": 1666002215, + "narHash": "sha256-9NOwAxpba7g7uq7XAjAQzoqZSJDldgutjCy/FS2lcAg=", "owner": "tweag", "repo": "jupyterWith", - "rev": "caf28b971fc92378ad26905a1abf47b1f8f56cf2", + "rev": "3f2fe565e421ad07ff81e139daa1f8eae4cfdd4b", "type": "github" }, "original": { @@ -591,22 +582,6 @@ "type": "github" } }, - "mirage-opam-overlays": { - "flake": false, - "locked": { - "lastModified": 1661959605, - "narHash": "sha256-CPTuhYML3F4J58flfp3ZbMNhkRkVFKmBEYBZY5tnQwA=", - "owner": "dune-universe", - "repo": "mirage-opam-overlays", - "rev": "05f1c1823d891ce4d8adab91f5db3ac51d86dc0b", - "type": "github" - }, - "original": { - "owner": "dune-universe", - "repo": "mirage-opam-overlays", - "type": "github" - } - }, "nix": { "inputs": { "lowdown-src": "lowdown-src", @@ -722,22 +697,6 @@ "type": "indirect" } }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1668459637, - "narHash": "sha256-HqnWCKujmtu8v0CjzOT0sr7m2AR7+vpbZJOp1R0rodY=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "16f4e04658c2ab10114545af2f39db17d51bd1bd", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-22.05", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-unstable": { "locked": { "lastModified": 1648219316, @@ -772,15 +731,15 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1668505710, - "narHash": "sha256-DulcfsGjpSXL9Ma0iQIsb3HRbARCDcA+CNH67pPyMQ0=", - "owner": "nixos", + "lastModified": 1634515797, + "narHash": "sha256-elgCUC2khtBkOSpE4gDymNvthTZAI4hGI2iNu3YEUkA=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "85d6b3990def7eef45f4502a82496de02a02b6e8", + "rev": "5f0194220f2402b06f7f79bba6351895facb5acb", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -788,35 +747,19 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1667901915, - "narHash": "sha256-IkSou5ox/yZ2YUhGpk8vxd2TNU2pwRlYtir5k55NaxE=", + "lastModified": 1653936696, + "narHash": "sha256-M6bJShji9AIDZ7Kh7CPwPBPb/T7RiVev2PAcOi4fxDQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "093268502280540a7f5bf1e2a6330a598ba3b7d0", + "rev": "ce6aa13369b667ac2542593170993504932eb836", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-unstable", + "ref": "22.05", "type": "indirect" } }, - "npmlock2nix": { - "flake": false, - "locked": { - "lastModified": 1666460237, - "narHash": "sha256-HME6rnysvCwUVtH+BDWDGahmweMaLgD2wqHeRuGp6QI=", - "owner": "nix-community", - "repo": "npmlock2nix", - "rev": "eeed152290ec2425f96c5e74e469c40b621e1468", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "npmlock2nix", - "type": "github" - } - }, "old-ghc-nix": { "flake": false, "locked": { @@ -834,119 +777,6 @@ "type": "github" } }, - "opam-nix": { - "inputs": { - "flake-compat": [ - "jupyterWith", - "flake-compat" - ], - "flake-utils": [ - "jupyterWith", - "flake-utils" - ], - "mirage-opam-overlays": "mirage-opam-overlays", - "nixpkgs": [ - "jupyterWith", - "nixpkgs" - ], - "opam-overlays": "opam-overlays", - "opam-repository": "opam-repository", - "opam2json": "opam2json" - }, - "locked": { - "lastModified": 1669668269, - "narHash": "sha256-zouXEKblfmh3tBonA1bd3ZDrNlHE+rs257Eie6WXOJ0=", - "owner": "tweag", - "repo": "opam-nix", - "rev": "a5286f270b2b4d85465b1db8177e782a9acc5507", - "type": "github" - }, - "original": { - "owner": "tweag", - "ref": "fix-list-repo-func", - "repo": "opam-nix", - "type": "github" - } - }, - "opam-overlays": { - "flake": false, - "locked": { - "lastModified": 1654162756, - "narHash": "sha256-RV68fUK+O3zTx61iiHIoS0LvIk0E4voMp+0SwRg6G6c=", - "owner": "dune-universe", - "repo": "opam-overlays", - "rev": "c8f6ef0fc5272f254df4a971a47de7848cc1c8a4", - "type": "github" - }, - "original": { - "owner": "dune-universe", - "repo": "opam-overlays", - "type": "github" - } - }, - "opam-repository": { - "flake": false, - "locked": { - "lastModified": 1661161626, - "narHash": "sha256-J3P+mXLwE2oEKTlMnx8sYRxwD/uNGSKM0AkAB7BNTxA=", - "owner": "ocaml", - "repo": "opam-repository", - "rev": "54e69ff0949a3aaec0d5e3d67898bb7f279ab09f", - "type": "github" - }, - "original": { - "owner": "ocaml", - "repo": "opam-repository", - "type": "github" - } - }, - "opam2json": { - "inputs": { - "nixpkgs": [ - "jupyterWith", - "opam-nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1665671715, - "narHash": "sha256-7f75C6fIkiLzfkwLpJxlQIKf+YORGsXGV8Dr2LDDi+A=", - "owner": "tweag", - "repo": "opam2json", - "rev": "32fa2dcd993a27f9e75ee46fb8b78a7cd5d05113", - "type": "github" - }, - "original": { - "owner": "tweag", - "repo": "opam2json", - "type": "github" - } - }, - "poetry2nix": { - "inputs": { - "flake-utils": [ - "jupyterWith", - "flake-utils" - ], - "nixpkgs": [ - "jupyterWith", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1668394823, - "narHash": "sha256-UJqW+Zp1boVhTKfWel2WTi7Qn0R9hfpVeSRdJYPJwXQ=", - "owner": "nix-community", - "repo": "poetry2nix", - "rev": "3cc82ca6ccca2a06dbb05cb0b74efd5d50e60d48", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "poetry2nix", - "type": "github" - } - }, "pointfree": { "flake": false, "locked": { @@ -993,31 +823,6 @@ } }, "pre-commit-hooks_2": { - "inputs": { - "flake-utils": [ - "jupyterWith", - "flake-utils" - ], - "nixpkgs": [ - "jupyterWith", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1667992213, - "narHash": "sha256-8Ens8ozllvlaFMCZBxg6S7oUyynYx2v7yleC5M0jJsE=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "ebcbfe09d2bd6d15f68de3a0ebb1e4dcb5cd324b", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, - "pre-commit-hooks_3": { "inputs": { "flake-utils": [ "flake-utils" @@ -1027,11 +832,11 @@ ] }, "locked": { - "lastModified": 1667992213, - "narHash": "sha256-8Ens8ozllvlaFMCZBxg6S7oUyynYx2v7yleC5M0jJsE=", + "lastModified": 1665584211, + "narHash": "sha256-Qc9zn43UjLpP823BP416hAsoaXugwWw+nKPVqsNhqdY=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "ebcbfe09d2bd6d15f68de3a0ebb1e4dcb5cd324b", + "rev": "94b0f300dd9a23d4e851aa2a947a1511d3410e2d", "type": "github" }, "original": { @@ -1047,32 +852,7 @@ "haskell-nix-utils": "haskell-nix-utils", "jupyterWith": "jupyterWith", "nixpkgs": "nixpkgs_4", - "pre-commit-hooks": "pre-commit-hooks_3" - } - }, - "rust-overlay": { - "inputs": { - "flake-utils": [ - "jupyterWith", - "flake-utils" - ], - "nixpkgs": [ - "jupyterWith", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1668566441, - "narHash": "sha256-WjyKSpFY44ysIHSN3C0L5PKUJuwXDnSg6p5OcYwbZZ4=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "fd76032706405b6abe09bff25ca7e28ac1fa0043", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" + "pre-commit-hooks": "pre-commit-hooks_2" } }, "stackage": { diff --git a/flake.nix b/flake.nix index 1e203b0f..40bfe255 100644 --- a/flake.nix +++ b/flake.nix @@ -12,14 +12,27 @@ }; inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; - flake-compat.url = "github:edolstra/flake-compat"; - flake-compat.flake = false; + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; flake-utils.url = "github:numtide/flake-utils"; - pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; - pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs"; - pre-commit-hooks.inputs.flake-utils.follows = "flake-utils"; + pre-commit-hooks = { + url = "github:cachix/pre-commit-hooks.nix"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; haskell-nix-utils.url = "github:TerrorJack/haskell-nix-utils"; - jupyterWith.url = "github:tweag/jupyterWith"; + jupyterWith = { + url = "github:tweag/jupyterWith"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-compat.follows = "flake-compat"; + flake-utils.follows = "flake-utils"; + }; + }; }; outputs = { self, From e1408795f3923c4eff81373d9e6fce47632bc038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Thu, 9 Feb 2023 16:35:10 +0100 Subject: [PATCH 3/4] Update all flake inputs --- flake.lock | 474 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 414 insertions(+), 60 deletions(-) diff --git a/flake.lock b/flake.lock index 6d88fed1..42530e7a 100644 --- a/flake.lock +++ b/flake.lock @@ -151,11 +151,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", "type": "github" }, "original": { @@ -183,11 +183,11 @@ "flake-compat_3": { "flake": false, "locked": { - "lastModified": 1627913399, - "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", "owner": "edolstra", "repo": "flake-compat", - "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", "type": "github" }, "original": { @@ -196,28 +196,32 @@ "type": "github" } }, - "flake-utils": { + "flake-compat_4": { + "flake": false, "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "edolstra", + "repo": "flake-compat", "type": "github" } }, - "flake-utils_2": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", "owner": "numtide", "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", "type": "github" }, "original": { @@ -226,13 +230,13 @@ "type": "github" } }, - "flake-utils_3": { + "flake-utils_2": { "locked": { - "lastModified": 1631561581, - "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", "owner": "numtide", "repo": "flake-utils", - "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", "type": "github" }, "original": { @@ -241,7 +245,7 @@ "type": "github" } }, - "flake-utils_4": { + "flake-utils_3": { "locked": { "lastModified": 1629481132, "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=", @@ -322,6 +326,49 @@ "type": "github" } }, + "gitignore_2": { + "inputs": { + "nixpkgs": [ + "jupyterWith", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_3": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "hackage": { "flake": false, "locked": { @@ -441,8 +488,8 @@ }, "hls": { "inputs": { - "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_4", + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_3", "gitignore": "gitignore", "nixpkgs": "nixpkgs_2", "pre-commit-hooks": "pre-commit-hooks" @@ -520,22 +567,31 @@ }, "ihaskell": { "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_3", + "flake-compat": [ + "jupyterWith", + "flake-compat" + ], + "flake-utils": [ + "jupyterWith", + "flake-utils" + ], "hls": "hls", - "nixpkgs": "nixpkgs_3" + "nixpkgs": [ + "jupyterWith", + "nixpkgs" + ] }, "locked": { - "lastModified": 1665351472, - "narHash": "sha256-+gb735LCgBaiEG9WhjDbzsgwAI2oCRJZvbdVVCYYDzQ=", - "owner": "gibiansky", - "repo": "IHaskell", - "rev": "725d900414462da0f1859334a482e80c7a9e33d9", + "lastModified": 1671426600, + "narHash": "sha256-MahAFyp6AxY0H61U6zqJXM1NsckNNkK6iqONEtOPSK0=", + "owner": "ihaskell", + "repo": "ihaskell", + "rev": "1c22a874ac0c8ed019229f4a0cd5a0bfda017357", "type": "github" }, "original": { - "owner": "gibiansky", - "repo": "IHaskell", + "owner": "ihaskell", + "repo": "ihaskell", "type": "github" } }, @@ -548,16 +604,23 @@ "flake-utils" ], "ihaskell": "ihaskell", + "nix-dart": "nix-dart", "nixpkgs": [ "nixpkgs" - ] + ], + "nixpkgs-stable": "nixpkgs-stable", + "npmlock2nix": "npmlock2nix", + "opam-nix": "opam-nix", + "poetry2nix": "poetry2nix", + "pre-commit-hooks": "pre-commit-hooks_2", + "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1666002215, - "narHash": "sha256-9NOwAxpba7g7uq7XAjAQzoqZSJDldgutjCy/FS2lcAg=", + "lastModified": 1679071568, + "narHash": "sha256-3LAo9uXGTmfS4OsiiIuoxX9knEshziCyI1MxR40VKeU=", "owner": "tweag", "repo": "jupyterWith", - "rev": "3f2fe565e421ad07ff81e139daa1f8eae4cfdd4b", + "rev": "3ad2c9512c9efd586cf63adde454e734a8ce049c", "type": "github" }, "original": { @@ -582,6 +645,22 @@ "type": "github" } }, + "mirage-opam-overlays": { + "flake": false, + "locked": { + "lastModified": 1661959605, + "narHash": "sha256-CPTuhYML3F4J58flfp3ZbMNhkRkVFKmBEYBZY5tnQwA=", + "owner": "dune-universe", + "repo": "mirage-opam-overlays", + "rev": "05f1c1823d891ce4d8adab91f5db3ac51d86dc0b", + "type": "github" + }, + "original": { + "owner": "dune-universe", + "repo": "mirage-opam-overlays", + "type": "github" + } + }, "nix": { "inputs": { "lowdown-src": "lowdown-src", @@ -603,6 +682,32 @@ "type": "github" } }, + "nix-dart": { + "inputs": { + "flake-utils": [ + "jupyterWith", + "flake-utils" + ], + "nixpkgs": [ + "jupyterWith", + "nixpkgs" + ], + "pub2nix": "pub2nix" + }, + "locked": { + "lastModified": 1673740150, + "narHash": "sha256-JiZrr75JILHW7IaNW3MwpYn+084Q6/gnXScPR7Pozhs=", + "owner": "djacu", + "repo": "nix-dart", + "rev": "8ee4e1a5ec0cc6c1e15860c4733f741485e8231e", + "type": "github" + }, + "original": { + "owner": "djacu", + "repo": "nix-dart", + "type": "github" + } + }, "nix-tools": { "flake": false, "locked": { @@ -697,6 +802,54 @@ "type": "indirect" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1672580127, + "narHash": "sha256-3lW3xZslREhJogoOkjeZtlBtvFMyxHku7I/9IVehhT8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "0874168639713f547c05947c76124f78441ea46c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-22.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1673800717, + "narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_3": { + "locked": { + "lastModified": 1678872516, + "narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-unstable": { "locked": { "lastModified": 1648219316, @@ -731,33 +884,34 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1634515797, - "narHash": "sha256-elgCUC2khtBkOSpE4gDymNvthTZAI4hGI2iNu3YEUkA=", + "lastModified": 1682879489, + "narHash": "sha256-sASwo8gBt7JDnOOstnps90K1wxmVfyhsTPPNTGBPjjg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5f0194220f2402b06f7f79bba6351895facb5acb", + "rev": "da45bf6ec7bbcc5d1e14d3795c025199f28e0de0", "type": "github" }, "original": { - "owner": "NixOS", + "id": "nixpkgs", "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "indirect" } }, - "nixpkgs_4": { + "npmlock2nix": { + "flake": false, "locked": { - "lastModified": 1653936696, - "narHash": "sha256-M6bJShji9AIDZ7Kh7CPwPBPb/T7RiVev2PAcOi4fxDQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ce6aa13369b667ac2542593170993504932eb836", + "lastModified": 1668989938, + "narHash": "sha256-/IxdS0AiqSN0/VEOLnnfHyi4nP17yPrkhGf6KlXVwrc=", + "owner": "nix-community", + "repo": "npmlock2nix", + "rev": "0ba0746d62974403daf717cded3f24c617622bc7", "type": "github" }, "original": { - "id": "nixpkgs", - "ref": "22.05", - "type": "indirect" + "owner": "nix-community", + "repo": "npmlock2nix", + "rev": "0ba0746d62974403daf717cded3f24c617622bc7", + "type": "github" } }, "old-ghc-nix": { @@ -777,6 +931,119 @@ "type": "github" } }, + "opam-nix": { + "inputs": { + "flake-compat": [ + "jupyterWith", + "flake-compat" + ], + "flake-utils": [ + "jupyterWith", + "flake-utils" + ], + "mirage-opam-overlays": "mirage-opam-overlays", + "nixpkgs": [ + "jupyterWith", + "nixpkgs" + ], + "opam-overlays": "opam-overlays", + "opam-repository": "opam-repository", + "opam2json": "opam2json" + }, + "locked": { + "lastModified": 1669990974, + "narHash": "sha256-wHhdlDUC/tBDVFBemeJPpqdIRdehKKbxbdMP0QjOhM4=", + "owner": "tweag", + "repo": "opam-nix", + "rev": "75199758e1954f78286e7e79c0e3916e28b732b0", + "type": "github" + }, + "original": { + "owner": "tweag", + "repo": "opam-nix", + "rev": "75199758e1954f78286e7e79c0e3916e28b732b0", + "type": "github" + } + }, + "opam-overlays": { + "flake": false, + "locked": { + "lastModified": 1654162756, + "narHash": "sha256-RV68fUK+O3zTx61iiHIoS0LvIk0E4voMp+0SwRg6G6c=", + "owner": "dune-universe", + "repo": "opam-overlays", + "rev": "c8f6ef0fc5272f254df4a971a47de7848cc1c8a4", + "type": "github" + }, + "original": { + "owner": "dune-universe", + "repo": "opam-overlays", + "type": "github" + } + }, + "opam-repository": { + "flake": false, + "locked": { + "lastModified": 1661161626, + "narHash": "sha256-J3P+mXLwE2oEKTlMnx8sYRxwD/uNGSKM0AkAB7BNTxA=", + "owner": "ocaml", + "repo": "opam-repository", + "rev": "54e69ff0949a3aaec0d5e3d67898bb7f279ab09f", + "type": "github" + }, + "original": { + "owner": "ocaml", + "repo": "opam-repository", + "type": "github" + } + }, + "opam2json": { + "inputs": { + "nixpkgs": [ + "jupyterWith", + "opam-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1665671715, + "narHash": "sha256-7f75C6fIkiLzfkwLpJxlQIKf+YORGsXGV8Dr2LDDi+A=", + "owner": "tweag", + "repo": "opam2json", + "rev": "32fa2dcd993a27f9e75ee46fb8b78a7cd5d05113", + "type": "github" + }, + "original": { + "owner": "tweag", + "repo": "opam2json", + "type": "github" + } + }, + "poetry2nix": { + "inputs": { + "flake-utils": [ + "jupyterWith", + "flake-utils" + ], + "nixpkgs": [ + "jupyterWith", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1673926875, + "narHash": "sha256-QOsT76Al0Igpo0u5vtQJuDSOxrocX3sTD523pLPEklc=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "a5c454a834cd290dd4d33102ab8b4aa37d850e65", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, "pointfree": { "flake": false, "locked": { @@ -824,19 +1091,50 @@ }, "pre-commit-hooks_2": { "inputs": { + "flake-compat": "flake-compat_3", "flake-utils": [ + "jupyterWith", "flake-utils" ], + "gitignore": "gitignore_2", "nixpkgs": [ + "jupyterWith", "nixpkgs" - ] + ], + "nixpkgs-stable": "nixpkgs-stable_2" + }, + "locked": { + "lastModified": 1674075316, + "narHash": "sha256-0uZuAcYBpNJLxr7n5O0vhwn3rSLpUTm9M5WGgmNQ+wM=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "3e42a77571cc0463efa470dbcffa063977a521ab", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "pre-commit-hooks_3": { + "inputs": { + "flake-compat": "flake-compat_4", + "flake-utils": [ + "flake-utils" + ], + "gitignore": "gitignore_3", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1665584211, - "narHash": "sha256-Qc9zn43UjLpP823BP416hAsoaXugwWw+nKPVqsNhqdY=", + "lastModified": 1682596858, + "narHash": "sha256-Hf9XVpqaGqe/4oDGr30W8HlsWvJXtMsEPHDqHZA6dDg=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "94b0f300dd9a23d4e851aa2a947a1511d3410e2d", + "rev": "fb58866e20af98779017134319b5663b8215d912", "type": "github" }, "original": { @@ -845,14 +1143,55 @@ "type": "github" } }, + "pub2nix": { + "flake": false, + "locked": { + "lastModified": 1594192744, + "narHash": "sha256-pDvcXSG1Mh2BpwkqAcNDJzcupV3pIAAtZJLfkiHMAz4=", + "owner": "paulyoung", + "repo": "pub2nix", + "rev": "0c7ecca590fcd1616db8c6468f799ffef36c85e9", + "type": "github" + }, + "original": { + "owner": "paulyoung", + "repo": "pub2nix", + "type": "github" + } + }, "root": { "inputs": { "flake-compat": "flake-compat", "flake-utils": "flake-utils", "haskell-nix-utils": "haskell-nix-utils", "jupyterWith": "jupyterWith", - "nixpkgs": "nixpkgs_4", - "pre-commit-hooks": "pre-commit-hooks_2" + "nixpkgs": "nixpkgs_3", + "pre-commit-hooks": "pre-commit-hooks_3" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "jupyterWith", + "flake-utils" + ], + "nixpkgs": [ + "jupyterWith", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1674008920, + "narHash": "sha256-ugwPxKjvmJ5GpzN/MHg8tuhe8nYi3SbJm5nWNy7CB0Q=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "eecc44934a0f6c02c02856b38bd3b6af3bec0870", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } }, "stackage": { @@ -871,6 +1210,21 @@ "type": "github" } }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "warp-wo-x509": { "flake": false, "locked": { From 9605aa02a1b92b6d5d725db3129d74a60d45798f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Wed, 10 May 2023 13:04:41 +0200 Subject: [PATCH 4/4] Run ormolu --- models/HMM.hs | 2 +- src/Control/Monad/Bayes/Inference/MCMC.hs | 10 +++++----- src/Control/Monad/Bayes/Inference/TUI.hs | 4 +++- src/Control/Monad/Bayes/Population.hs | 8 ++++---- src/Control/Monad/Bayes/Sampler/Lazy.hs | 2 +- src/Control/Monad/Bayes/Traced/Basic.hs | 6 +++--- src/Control/Monad/Bayes/Traced/Common.hs | 4 ++-- src/Control/Monad/Bayes/Traced/Dynamic.hs | 6 +++--- src/Control/Monad/Bayes/Traced/Static.hs | 6 +++--- src/Math/Integrators/StormerVerlet.hs | 10 +++++----- test/TestSampler.hs | 2 +- test/TestStormerVerlet.hs | 4 ++-- 12 files changed, 33 insertions(+), 31 deletions(-) diff --git a/models/HMM.hs b/models/HMM.hs index 99fb719b..d9415240 100644 --- a/models/HMM.hs +++ b/models/HMM.hs @@ -15,7 +15,7 @@ import Data.Maybe (fromJust, isJust) import Data.Vector (fromList) import Pipes (MFunctor (hoist), MonadTrans (lift), each, yield, (>->)) import Pipes.Core (Producer) -import qualified Pipes.Prelude as Pipes +import Pipes.Prelude qualified as Pipes -- | Observed values values :: [Double] diff --git a/src/Control/Monad/Bayes/Inference/MCMC.hs b/src/Control/Monad/Bayes/Inference/MCMC.hs index 2aadded7..4ea54bc6 100644 --- a/src/Control/Monad/Bayes/Inference/MCMC.hs +++ b/src/Control/Monad/Bayes/Inference/MCMC.hs @@ -12,19 +12,19 @@ module Control.Monad.Bayes.Inference.MCMC where import Control.Monad.Bayes.Class (MonadDistribution) -import qualified Control.Monad.Bayes.Traced.Basic as Basic +import Control.Monad.Bayes.Traced.Basic qualified as Basic import Control.Monad.Bayes.Traced.Common ( MHResult (MHResult, trace), Trace (probDensity), burnIn, mhTransWithBool, ) -import qualified Control.Monad.Bayes.Traced.Dynamic as Dynamic -import qualified Control.Monad.Bayes.Traced.Static as Static +import Control.Monad.Bayes.Traced.Dynamic qualified as Dynamic +import Control.Monad.Bayes.Traced.Static qualified as Static import Control.Monad.Bayes.Weighted (Weighted, unweighted) import Pipes ((>->)) -import qualified Pipes as P -import qualified Pipes.Prelude as P +import Pipes qualified as P +import Pipes.Prelude qualified as P data Proposal = SingleSiteMH diff --git a/src/Control/Monad/Bayes/Inference/TUI.hs b/src/Control/Monad/Bayes/Inference/TUI.hs index 494afcef..cd7fefd0 100644 --- a/src/Control/Monad/Bayes/Inference/TUI.hs +++ b/src/Control/Monad/Bayes/Inference/TUI.hs @@ -57,7 +57,9 @@ drawUI handleSamples state = [ui] (toDoAttr, B.progressIncompleteAttr) ] ) - $ toBar $ fromIntegral $ numSteps state + $ toBar + $ fromIntegral + $ numSteps state likelihoodBar = updateAttrMap diff --git a/src/Control/Monad/Bayes/Population.hs b/src/Control/Monad/Bayes/Population.hs index be670df2..d937f67a 100644 --- a/src/Control/Monad/Bayes/Population.hs +++ b/src/Control/Monad/Bayes/Population.hs @@ -181,11 +181,11 @@ stratified weights = do cumulativeSum = V.scanl (+) 0.0 weights coalg (i, j) | i < bigN = - if (positions ! i) < (cumulativeSum ! j) - then Just (Just j, (i + 1, j)) - else Just (Nothing, (i, j + 1)) + if (positions ! i) < (cumulativeSum ! j) + then Just (Just j, (i + 1, j)) + else Just (Nothing, (i, j + 1)) | otherwise = - Nothing + Nothing return $ map (\i -> i - 1) $ catMaybes $ unfoldr coalg (0, 0) -- | Resample the population using the underlying monad and a stratified resampling scheme. diff --git a/src/Control/Monad/Bayes/Sampler/Lazy.hs b/src/Control/Monad/Bayes/Sampler/Lazy.hs index 3bedbe59..470b508b 100644 --- a/src/Control/Monad/Bayes/Sampler/Lazy.hs +++ b/src/Control/Monad/Bayes/Sampler/Lazy.hs @@ -15,7 +15,7 @@ import System.Random getStdGen, newStdGen, ) -import qualified System.Random as R +import System.Random qualified as R -- | A 'Tree' is a lazy, infinitely wide and infinitely deep tree, labelled by Doubles -- | Our source of randomness will be a Tree, populated by uniform [0,1] choices for each label. diff --git a/src/Control/Monad/Bayes/Traced/Basic.hs b/src/Control/Monad/Bayes/Traced/Basic.hs index 1e540aa8..c0b76ea9 100644 --- a/src/Control/Monad/Bayes/Traced/Basic.hs +++ b/src/Control/Monad/Bayes/Traced/Basic.hs @@ -85,6 +85,6 @@ mh n (Traced m d) = fmap (map output . NE.toList) (f n) f k | k <= 0 = fmap (:| []) d | otherwise = do - (x :| xs) <- f (k - 1) - y <- mhTrans' m x - return (y :| x : xs) + (x :| xs) <- f (k - 1) + y <- mhTrans' m x + return (y :| x : xs) diff --git a/src/Control/Monad/Bayes/Traced/Common.hs b/src/Control/Monad/Bayes/Traced/Common.hs index ba0ce9ef..ee5a41f4 100644 --- a/src/Control/Monad/Bayes/Traced/Common.hs +++ b/src/Control/Monad/Bayes/Traced/Common.hs @@ -24,8 +24,8 @@ import Control.Monad.Bayes.Class ( MonadDistribution (bernoulli, random), discrete, ) -import qualified Control.Monad.Bayes.Density.Free as Free -import qualified Control.Monad.Bayes.Density.State as State +import Control.Monad.Bayes.Density.Free qualified as Free +import Control.Monad.Bayes.Density.State qualified as State import Control.Monad.Bayes.Weighted as Weighted ( Weighted, hoist, diff --git a/src/Control/Monad/Bayes/Traced/Dynamic.hs b/src/Control/Monad/Bayes/Traced/Dynamic.hs index d2b92021..d42cd9c7 100644 --- a/src/Control/Monad/Bayes/Traced/Dynamic.hs +++ b/src/Control/Monad/Bayes/Traced/Dynamic.hs @@ -105,7 +105,7 @@ mh n (Traced c) = do let f k | k <= 0 = return (t :| []) | otherwise = do - (x :| xs) <- f (k - 1) - y <- mhTransFree m x - return (y :| x : xs) + (x :| xs) <- f (k - 1) + y <- mhTransFree m x + return (y :| x : xs) fmap (map output . NE.toList) (f n) diff --git a/src/Control/Monad/Bayes/Traced/Static.hs b/src/Control/Monad/Bayes/Traced/Static.hs index 01f0c543..640c9599 100644 --- a/src/Control/Monad/Bayes/Traced/Static.hs +++ b/src/Control/Monad/Bayes/Traced/Static.hs @@ -117,6 +117,6 @@ mh n (Traced m d) = fmap (map output . NE.toList) (f n) f k | k <= 0 = fmap (:| []) d | otherwise = do - (x :| xs) <- f (k - 1) - y <- mhTransFree m x - return (y :| x : xs) + (x :| xs) <- f (k - 1) + y <- mhTransFree m x + return (y :| x : xs) diff --git a/src/Math/Integrators/StormerVerlet.hs b/src/Math/Integrators/StormerVerlet.hs index 6b48229e..0d174966 100644 --- a/src/Math/Integrators/StormerVerlet.hs +++ b/src/Math/Integrators/StormerVerlet.hs @@ -8,7 +8,7 @@ where import Control.Lens import Control.Monad.Primitive import Data.Vector (Vector, (!)) -import qualified Data.Vector as V +import Data.Vector qualified as V import Data.Vector.Mutable import Linear (V2 (..)) @@ -71,7 +71,7 @@ integrateV integrator initial times = do compute y i out | i == V.length times = return () | otherwise = do - let h = (times ! i) - (times ! (i - 1)) - y' = integrator h y - write out i y' - compute y' (i + 1) out + let h = (times ! i) - (times ! (i - 1)) + y' = integrator h y + write out i y' + compute y' (i + 1) out diff --git a/test/TestSampler.hs b/test/TestSampler.hs index f746b9ee..26d11461 100644 --- a/test/TestSampler.hs +++ b/test/TestSampler.hs @@ -1,6 +1,6 @@ module TestSampler where -import qualified Control.Foldl as Fold +import Control.Foldl qualified as Fold import Control.Monad (replicateM) import Control.Monad.Bayes.Class (MonadDistribution (normal)) import Control.Monad.Bayes.Sampler.Strict (sampleSTfixed) diff --git a/test/TestStormerVerlet.hs b/test/TestStormerVerlet.hs index 9dc510a6..367cb312 100644 --- a/test/TestStormerVerlet.hs +++ b/test/TestStormerVerlet.hs @@ -6,8 +6,8 @@ where import Control.Lens import Control.Monad.ST import Data.Maybe (fromJust) -import qualified Data.Vector as V -import qualified Linear as L +import Data.Vector qualified as V +import Linear qualified as L import Linear.V import Math.Integrators.StormerVerlet import Statistics.Function (square)