From a81b2e02af537925a2d97d8f71bc33c68d79f523 Mon Sep 17 00:00:00 2001 From: justin Date: Sat, 7 Sep 2024 17:43:36 -0700 Subject: [PATCH] move to new flake system --- .envrc | 2 + .github/workflows/flake-ci.yml | 78 ++++ .gitignore | 4 +- app/Examples.hs | 4 +- flake.lock | 730 +++++++++++++++++++++++++++++++++ flake.nix | 37 ++ fourmolu.yaml | 17 + hamilton.cabal | 69 ++++ package.yaml | 58 --- stack.yaml | 74 ---- stack.yaml.lock | 33 -- 11 files changed, 938 insertions(+), 168 deletions(-) create mode 100644 .envrc create mode 100644 .github/workflows/flake-ci.yml create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 fourmolu.yaml create mode 100644 hamilton.cabal delete mode 100644 package.yaml delete mode 100644 stack.yaml delete mode 100644 stack.yaml.lock diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..a971e5d --- /dev/null +++ b/.envrc @@ -0,0 +1,2 @@ +watch_file *.cabal +use flake diff --git a/.github/workflows/flake-ci.yml b/.github/workflows/flake-ci.yml new file mode 100644 index 0000000..fc42867 --- /dev/null +++ b/.github/workflows/flake-ci.yml @@ -0,0 +1,78 @@ +name: "Flake CI" +on: + pull_request: + push: +jobs: + checks: + runs-on: ubuntu-latest + steps: + - name: Free Disk Space + uses: insightsengineering/free-disk-space@v1.1.0 + - uses: actions/checkout@v3 + - uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + - uses: cachix/install-nix-action@v22 + with: + nix_path: nixpkgs=channel:nixos-unstable + github_access_token: ${{ secrets.GITHUB_TOKEN }} + extra_nix_config: | + trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk= + allow-import-from-derivation = true + auto-optimise-store = true + substituters = https://hydra.iohk.io https://cache.nixos.org/ https://cache.iog.io https://cache.zw3rk.com https://mstksg.cachix.org + - uses: cachix/cachix-action@v13 + with: + name: mstksg + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix flake check --show-trace + + cache: + runs-on: ubuntu-latest + steps: + - name: Free Disk Space + uses: insightsengineering/free-disk-space@v1.1.0 + - uses: actions/checkout@v4.1.1 + - uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + - uses: cachix/install-nix-action@v22 + with: + nix_path: nixpkgs=channel:nixos-unstable + github_access_token: ${{ secrets.GITHUB_TOKEN }} + extra_nix_config: | + trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk= + allow-import-from-derivation = true + auto-optimise-store = true + substituters = https://hydra.iohk.io https://cache.nixos.org/ https://cache.iog.io https://cache.zw3rk.com https://mstksg.cachix.org + - uses: cachix/cachix-action@v13 + with: + name: mstksg + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix build --show-trace + - run: nix develop --show-trace + + every-compiler: + runs-on: ubuntu-latest + steps: + - name: Free Disk Space + uses: insightsengineering/free-disk-space@v1.1.0 + - uses: actions/checkout@v3 + - uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + - uses: cachix/install-nix-action@v22 + with: + nix_path: nixpkgs=channel:nixos-unstable + github_access_token: ${{ secrets.GITHUB_TOKEN }} + extra_nix_config: | + trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk= + allow-import-from-derivation = true + auto-optimise-store = true + substituters = https://hydra.iohk.io https://cache.nixos.org/ https://cache.iog.io https://cache.zw3rk.com https://mstksg.cachix.org + - uses: cachix/cachix-action@v13 + with: + name: mstksg + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix build .#everyCompiler + diff --git a/.gitignore b/.gitignore index 39b5a6f..6eac901 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /.stack-work /src/highlight.js /src/style.css - -/hamilton.cabal +/dist-newstyle +/.direnv diff --git a/app/Examples.hs b/app/Examples.hs index e0981d9..bc0f65b 100644 --- a/app/Examples.hs +++ b/app/Examples.hs @@ -39,6 +39,8 @@ import Data.List import Data.Semigroup ((<>)) import GHC.TypeLits import Graphics.Vty hiding (Config, (<|>)) +import Graphics.Vty.Config +import Graphics.Vty.CrossPlatform (mkVty) import Numeric.Hamilton import Numeric.LinearAlgebra.Static hiding (dim, (<>)) import Numeric.LinearAlgebra.Static.Vector @@ -315,7 +317,7 @@ main = do <> progDescDoc (Just descr) ) - vty <- mkVty =<< standardIOConfig + vty <- mkVty defaultConfig opts <- newIORef $ SO 0.5 1 25 diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5ea8a4a --- /dev/null +++ b/flake.lock @@ -0,0 +1,730 @@ +{ + "nodes": { + "HTTP": { + "flake": false, + "locked": { + "lastModified": 1451647621, + "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", + "owner": "phadej", + "repo": "HTTP", + "rev": "9bc0996d412fef1787449d841277ef663ad9a915", + "type": "github" + }, + "original": { + "owner": "phadej", + "repo": "HTTP", + "type": "github" + } + }, + "cabal-32": { + "flake": false, + "locked": { + "lastModified": 1603716527, + "narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=", + "owner": "haskell", + "repo": "cabal", + "rev": "48bf10787e27364730dd37a42b603cee8d6af7ee", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.2", + "repo": "cabal", + "type": "github" + } + }, + "cabal-34": { + "flake": false, + "locked": { + "lastModified": 1645834128, + "narHash": "sha256-wG3d+dOt14z8+ydz4SL7pwGfe7SiimxcD/LOuPCV6xM=", + "owner": "haskell", + "repo": "cabal", + "rev": "5ff598c67f53f7c4f48e31d722ba37172230c462", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.4", + "repo": "cabal", + "type": "github" + } + }, + "cabal-36": { + "flake": false, + "locked": { + "lastModified": 1669081697, + "narHash": "sha256-I5or+V7LZvMxfbYgZATU4awzkicBwwok4mVoje+sGmU=", + "owner": "haskell", + "repo": "cabal", + "rev": "8fd619e33d34924a94e691c5fea2c42f0fc7f144", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.6", + "repo": "cabal", + "type": "github" + } + }, + "cardano-shell": { + "flake": false, + "locked": { + "lastModified": 1608537748, + "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", + "owner": "input-output-hk", + "repo": "cardano-shell", + "rev": "9392c75087cb9a3d453998f4230930dea3a95725", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-shell", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1672831974, + "narHash": "sha256-z9k3MfslLjWQfnjBtEtJZdq3H7kyi2kQtUThfTgdRk0=", + "owner": "input-output-hk", + "repo": "flake-compat", + "rev": "45f2638735f8cdc40fe302742b79f248d23eb368", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "hkm/gitlab-fix", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "ghc-8.6.5-iohk": { + "flake": false, + "locked": { + "lastModified": 1600920045, + "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", + "owner": "input-output-hk", + "repo": "ghc", + "rev": "95713a6ecce4551240da7c96b6176f980af75cae", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "release/8.6.5-iohk", + "repo": "ghc", + "type": "github" + } + }, + "hackage": { + "flake": false, + "locked": { + "lastModified": 1719880711, + "narHash": "sha256-l6O9JzsNm0hK7AKHeegzQZ7FvAlzM5qxHIWOXMebzCk=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "4b1044b947c482975b30a029a42e8e73a3bec073", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "haskellNix": { + "inputs": { + "HTTP": "HTTP", + "cabal-32": "cabal-32", + "cabal-34": "cabal-34", + "cabal-36": "cabal-36", + "cardano-shell": "cardano-shell", + "flake-compat": "flake-compat", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", + "hackage": "hackage", + "hls-1.10": "hls-1.10", + "hls-2.0": "hls-2.0", + "hls-2.2": "hls-2.2", + "hls-2.3": "hls-2.3", + "hls-2.4": "hls-2.4", + "hls-2.5": "hls-2.5", + "hls-2.6": "hls-2.6", + "hls-2.7": "hls-2.7", + "hls-2.8": "hls-2.8", + "hpc-coveralls": "hpc-coveralls", + "hydra": "hydra", + "iserv-proxy": "iserv-proxy", + "nixpkgs": [ + "haskellProjectFlake", + "haskellNix", + "nixpkgs-unstable" + ], + "nixpkgs-2003": "nixpkgs-2003", + "nixpkgs-2105": "nixpkgs-2105", + "nixpkgs-2111": "nixpkgs-2111", + "nixpkgs-2205": "nixpkgs-2205", + "nixpkgs-2211": "nixpkgs-2211", + "nixpkgs-2305": "nixpkgs-2305", + "nixpkgs-2311": "nixpkgs-2311", + "nixpkgs-unstable": "nixpkgs-unstable", + "old-ghc-nix": "old-ghc-nix", + "stackage": "stackage" + }, + "locked": { + "lastModified": 1719881433, + "narHash": "sha256-q995hk+Ez6itYO9no8zeF0hrmTm4RmtSPy38E1qdgyE=", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "ba1756105ba7c77bbffbc1e39e6a72a33257e8d1", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "haskell.nix", + "type": "github" + } + }, + "haskellProjectFlake": { + "inputs": { + "flake-utils": "flake-utils_2", + "haskellNix": "haskellNix", + "nixpkgs": [ + "haskellProjectFlake", + "haskellNix", + "nixpkgs-unstable" + ] + }, + "locked": { + "lastModified": 1720638378, + "narHash": "sha256-D8NUpQGw2WlC34kQ2IJATLGuFkwNvu18TYQok5lp40s=", + "owner": "mstksg", + "repo": "haskell-project-flake", + "rev": "ef0afa913c13947793e77b1b844775071bfdb988", + "type": "github" + }, + "original": { + "owner": "mstksg", + "repo": "haskell-project-flake", + "type": "github" + } + }, + "hls-1.10": { + "flake": false, + "locked": { + "lastModified": 1680000865, + "narHash": "sha256-rc7iiUAcrHxwRM/s0ErEsSPxOR3u8t7DvFeWlMycWgo=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "b08691db779f7a35ff322b71e72a12f6e3376fd9", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "1.10.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.0": { + "flake": false, + "locked": { + "lastModified": 1687698105, + "narHash": "sha256-OHXlgRzs/kuJH8q7Sxh507H+0Rb8b7VOiPAjcY9sM1k=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "783905f211ac63edf982dd1889c671653327e441", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.0.0.1", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.2": { + "flake": false, + "locked": { + "lastModified": 1693064058, + "narHash": "sha256-8DGIyz5GjuCFmohY6Fa79hHA/p1iIqubfJUTGQElbNk=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "b30f4b6cf5822f3112c35d14a0cba51f3fe23b85", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.2.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.3": { + "flake": false, + "locked": { + "lastModified": 1695910642, + "narHash": "sha256-tR58doOs3DncFehHwCLczJgntyG/zlsSd7DgDgMPOkI=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "458ccdb55c9ea22cd5d13ec3051aaefb295321be", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.3.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.4": { + "flake": false, + "locked": { + "lastModified": 1699862708, + "narHash": "sha256-YHXSkdz53zd0fYGIYOgLt6HrA0eaRJi9mXVqDgmvrjk=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "54507ef7e85fa8e9d0eb9a669832a3287ffccd57", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.4.0.1", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.5": { + "flake": false, + "locked": { + "lastModified": 1701080174, + "narHash": "sha256-fyiR9TaHGJIIR0UmcCb73Xv9TJq3ht2ioxQ2mT7kVdc=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "27f8c3d3892e38edaef5bea3870161815c4d014c", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.5.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.6": { + "flake": false, + "locked": { + "lastModified": 1705325287, + "narHash": "sha256-+P87oLdlPyMw8Mgoul7HMWdEvWP/fNlo8jyNtwME8E8=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "6e0b342fa0327e628610f2711f8c3e4eaaa08b1e", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.6.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.7": { + "flake": false, + "locked": { + "lastModified": 1708965829, + "narHash": "sha256-LfJ+TBcBFq/XKoiNI7pc4VoHg4WmuzsFxYJ3Fu+Jf+M=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "50322b0a4aefb27adc5ec42f5055aaa8f8e38001", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.7.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.8": { + "flake": false, + "locked": { + "lastModified": 1715153580, + "narHash": "sha256-Vi/iUt2pWyUJlo9VrYgTcbRviWE0cFO6rmGi9rmALw0=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "dd1be1beb16700de59e0d6801957290bcf956a0a", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.8.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hpc-coveralls": { + "flake": false, + "locked": { + "lastModified": 1607498076, + "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", + "type": "github" + }, + "original": { + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "type": "github" + } + }, + "hydra": { + "inputs": { + "nix": "nix", + "nixpkgs": [ + "haskellProjectFlake", + "haskellNix", + "hydra", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1671755331, + "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", + "owner": "NixOS", + "repo": "hydra", + "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", + "type": "github" + }, + "original": { + "id": "hydra", + "type": "indirect" + } + }, + "iserv-proxy": { + "flake": false, + "locked": { + "lastModified": 1717479972, + "narHash": "sha256-7vE3RQycHI1YT9LHJ1/fUaeln2vIpYm6Mmn8FTpYeVo=", + "owner": "stable-haskell", + "repo": "iserv-proxy", + "rev": "2ed34002247213fc435d0062350b91bab920626e", + "type": "github" + }, + "original": { + "owner": "stable-haskell", + "ref": "iserv-syms", + "repo": "iserv-proxy", + "type": "github" + } + }, + "lowdown-src": { + "flake": false, + "locked": { + "lastModified": 1633514407, + "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", + "type": "github" + }, + "original": { + "owner": "kristapsdz", + "repo": "lowdown", + "type": "github" + } + }, + "nix": { + "inputs": { + "lowdown-src": "lowdown-src", + "nixpkgs": "nixpkgs", + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1661606874, + "narHash": "sha256-9+rpYzI+SmxJn+EbYxjGv68Ucp22bdFUSy/4LkHkkDQ=", + "owner": "NixOS", + "repo": "nix", + "rev": "11e45768b34fdafdcf019ddbd337afa16127ff0f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "2.11.0", + "repo": "nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1657693803, + "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "365e1b3a859281cf11b94f87231adeabbdd878a2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.05-small", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2003": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105": { + "locked": { + "lastModified": 1659914493, + "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2111": { + "locked": { + "lastModified": 1659446231, + "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2205": { + "locked": { + "lastModified": 1685573264, + "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "380be19fbd2d9079f677978361792cb25e8a3635", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-22.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2211": { + "locked": { + "lastModified": 1688392541, + "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-22.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2305": { + "locked": { + "lastModified": 1701362232, + "narHash": "sha256-GVdzxL0lhEadqs3hfRLuj+L1OJFGiL/L7gCcelgBlsw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d2332963662edffacfddfad59ff4f709dde80ffe", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-23.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2311": { + "locked": { + "lastModified": 1701386440, + "narHash": "sha256-xI0uQ9E7JbmEy/v8kR9ZQan6389rHug+zOtZeZFiDJk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "293822e55ec1872f715a66d0eda9e592dc14419f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-23.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1694822471, + "narHash": "sha256-6fSDCj++lZVMZlyqOe9SIOL8tYSBz1bI8acwovRwoX8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", + "type": "github" + } + }, + "old-ghc-nix": { + "flake": false, + "locked": { + "lastModified": 1631092763, + "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", + "owner": "angerman", + "repo": "old-ghc-nix", + "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", + "type": "github" + }, + "original": { + "owner": "angerman", + "ref": "master", + "repo": "old-ghc-nix", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "haskellProjectFlake": "haskellProjectFlake", + "nixpkgs": [ + "haskellProjectFlake", + "nixpkgs" + ] + } + }, + "stackage": { + "flake": false, + "locked": { + "lastModified": 1719879847, + "narHash": "sha256-6dqYwS1aUwn8bm+8Tan/tNGmEoWbjArBKO/jTh964f8=", + "owner": "input-output-hk", + "repo": "stackage.nix", + "rev": "562135a1623b181e8a4fd8d76c63827d9f4417c6", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "stackage.nix", + "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" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b2e5a3a --- /dev/null +++ b/flake.nix @@ -0,0 +1,37 @@ +{ + description = "Basic Haskell Project Flake"; + inputs = { + haskellProjectFlake.url = "github:mstksg/haskell-project-flake"; + nixpkgs.follows = "haskellProjectFlake/nixpkgs"; + }; + outputs = + { self + , nixpkgs + , flake-utils + , haskellProjectFlake + }: + flake-utils.lib.eachDefaultSystem (system: + let + name = "hamilton"; + pkgs = import nixpkgs { + inherit system; + overlays = [ haskellProjectFlake.overlays."${system}".default ]; + }; + project-flake = pkgs.haskell-project-flake + { + inherit name; + src = ./.; + excludeCompilerMajors = []; + defaultCompiler = "ghc982"; + }; + in + { + packages = project-flake.packages; + apps = project-flake.apps; + checks = project-flake.checks; + devShells = project-flake.devShells; + legacyPackages."${name}" = project-flake; + } + ); +} + diff --git a/fourmolu.yaml b/fourmolu.yaml new file mode 100644 index 0000000..6a59f5d --- /dev/null +++ b/fourmolu.yaml @@ -0,0 +1,17 @@ +column-limit: 100 +comma-style: leading +fixities: [] +function-arrows: trailing +haddock-style: single-line +haddock-style-module: null +import-export-style: diff-friendly +in-style: right-align +indent-wheres: true +indentation: 2 +let-style: inline +newlines-between-decls: 1 +record-break-space: true +reexports: [] +respectful: true +single-constraint-parens: never +unicode: detect diff --git a/hamilton.cabal b/hamilton.cabal new file mode 100644 index 0000000..981b6ea --- /dev/null +++ b/hamilton.cabal @@ -0,0 +1,69 @@ +cabal-version: 1.12 + +-- This file has been generated from package.yaml by hpack version 0.36.1. +-- +-- see: https://github.com/sol/hpack + +name: hamilton +version: 0.1.0.4 +synopsis: + Physics on generalized coordinate systems using Hamiltonian Mechanics and AD + +description: + See README.md (or read online at ) + +category: Physics +homepage: https://github.com/mstksg/hamilton#readme +bug-reports: https://github.com/mstksg/hamilton/issues +author: Justin Le +maintainer: justin@jle.im +copyright: (c) Justin Le 2018 +license: BSD3 +license-file: LICENSE +build-type: Simple +tested-with: GHC >=8.0 +extra-source-files: + CHANGELOG.md + README.md + +source-repository head + type: git + location: https://github.com/mstksg/hamilton + +library + exposed-modules: Numeric.Hamilton + other-modules: Paths_hamilton + hs-source-dirs: src + ghc-options: -Wall -O2 + build-depends: + ad + , base >=4.9 && <5 + , hmatrix >=0.18 + , hmatrix-gsl >=0.18 + , hmatrix-vector-sized >=0.1.3 + , typelits-witnesses >=0.2.3 + , vector-sized >=1.0 + + default-language: Haskell2010 + +executable hamilton-examples + main-is: Examples.hs + other-modules: Paths_hamilton + hs-source-dirs: app + ghc-options: -Wall -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: + ansi-wl-pprint + , base >=4.9 && <5 + , containers + , finite-typelits + , ghc-typelits-knownnat + , hamilton + , hmatrix >=0.18 + , hmatrix-vector-sized >=0.1.3 + , optparse-applicative >=0.13 + , vector + , vector-sized >=1.0 + , vty + , vty-crossplatform + + default-language: Haskell2010 diff --git a/package.yaml b/package.yaml deleted file mode 100644 index b6c8c7b..0000000 --- a/package.yaml +++ /dev/null @@ -1,58 +0,0 @@ -name: hamilton -version: 0.1.0.4 -github: mstksg/hamilton -license: BSD3 -author: Justin Le -maintainer: justin@jle.im -copyright: (c) Justin Le 2018 -tested-with: GHC >= 8.0 - -extra-source-files: -- README.md -- CHANGELOG.md - -# Metadata used when publishing your package -synopsis: Physics on generalized coordinate systems using Hamiltonian Mechanics and AD -category: Physics - -# To avoid duplicated efforts in documentation and dealing with the -# complications of embedding Haddock markup inside cabal files, it is -# common to point users to the README.md file. -description: See README.md (or read online at ) - -ghc-options: -- -Wall -- -O2 - -dependencies: -- base >=4.9 && <5 -- hmatrix >=0.18 -- vector-sized >=1.0 -- hmatrix-vector-sized >=0.1.3 - -library: - source-dirs: src - exposed-modules: - - Numeric.Hamilton - dependencies: - - ad - - hmatrix-gsl >=0.18 - - typelits-witnesses >=0.2.3 - -executables: - hamilton-examples: - main: Examples.hs - source-dirs: app - ghc-options: - - -threaded - - -rtsopts - - -with-rtsopts=-N - dependencies: - - ansi-wl-pprint - - containers - - finite-typelits - - ghc-typelits-knownnat - - hamilton - - optparse-applicative >=0.13 - - vector - - vty diff --git a/stack.yaml b/stack.yaml deleted file mode 100644 index 459e7d3..0000000 --- a/stack.yaml +++ /dev/null @@ -1,74 +0,0 @@ -# This file was automatically generated by 'stack init' -# -# Some commonly used options have been documented as comments in this file. -# For advanced use and comprehensive documentation of the format, please see: -# http://docs.haskellstack.org/en/stable/yaml_configuration/ - -# Resolver to choose a 'specific' stackage snapshot or a compiler version. -# A snapshot resolver dictates the compiler version and the set of packages -# to be used for project dependencies. For example: -# -# resolver: lts-3.5 -# resolver: nightly-2015-09-21 -# resolver: ghc-7.10.2 -# resolver: ghcjs-0.1.0_ghc-7.10.2 -# resolver: -# name: custom-snapshot -# location: "./custom-snapshot.yaml" -resolver: nightly-2019-02-11 - -# User packages to be built. -# Various formats can be used as shown in the example below. -# -# packages: -# - some-directory -# - https://example.com/foo/bar/baz-0.0.2.tar.gz -# - location: -# git: https://github.com/commercialhaskell/stack.git -# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a -# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a -# extra-dep: true -# subdirs: -# - auto-update -# - wai -# -# A package marked 'extra-dep: true' will only be built if demanded by a -# non-dependency (i.e. a user package), and its test suites and benchmarks -# will not be run. This is useful for tweaking upstream packages. -packages: -- '.' - -# Dependency packages to be pulled from upstream that are not in the resolver -# (e.g., acme-missiles-0.3) -extra-deps: -- vector-sized-1.4.0.0 -- hmatrix-vector-sized-0.1.3.0 -- indexed-list-literals-0.2.1.2 -# - vty-5.25.1 -# - finite-typelits-0.1.4.2 -# - hmatrix-vector-sized-0.1.2.0 -# - indexed-list-literals-0.2.1.2 - -# Override default flag values for local packages and extra-deps -flags: {} - -# Extra package databases containing global packages -extra-package-dbs: [] - -# Control whether we use the GHC we find on the path -# system-ghc: true -# -# Require a specific version of stack, using version ranges -# require-stack-version: -any # Default -# require-stack-version: ">=1.1" -# -# Override the architecture used by stack, especially useful on Windows -# arch: i386 -# arch: x86_64 -# -# Extra directories used by stack for building -# extra-include-dirs: [/path/to/dir] -# extra-lib-dirs: [/path/to/dir] -# -# Allow a newer minor version of GHC than the snapshot specifies -# compiler-check: newer-minor diff --git a/stack.yaml.lock b/stack.yaml.lock deleted file mode 100644 index 6da3e34..0000000 --- a/stack.yaml.lock +++ /dev/null @@ -1,33 +0,0 @@ -# This file was autogenerated by Stack. -# You should not edit this file by hand. -# For more information, please see the documentation at: -# https://docs.haskellstack.org/en/stable/lock_files - -packages: -- completed: - hackage: vector-sized-1.4.0.0@sha256:8c2df1e748bfbab86e177934519995f5c5da66ea0df481104e1dcdc2f7c1a831,1681 - pantry-tree: - size: 1139 - sha256: 21759821984ff50c2a5f2f2843bd7f3b46e8bbfcfe25c13ca4d290ad4f2027ee - original: - hackage: vector-sized-1.4.0.0 -- completed: - hackage: hmatrix-vector-sized-0.1.3.0@sha256:033d957faaae94024aeffb860329290cd0ad65e79e551ff847bf6e26cc4c9709,1881 - pantry-tree: - size: 403 - sha256: 8e9403c36a40011663b9b3e997d985ad6a8e1e55536ef97541c512776b6aa3c7 - original: - hackage: hmatrix-vector-sized-0.1.3.0 -- completed: - hackage: indexed-list-literals-0.2.1.2@sha256:8cca1b63332948ced0cd48d776b103add06de0180d153d60dd69945105af10a5,2464 - pantry-tree: - size: 341 - sha256: d1890c0ebaaacacd9ec849ed16bc29182314159745658c8c719b6ed684617c68 - original: - hackage: indexed-list-literals-0.2.1.2 -snapshots: -- completed: - size: 504398 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2019/2/11.yaml - sha256: 3f5e294567a2d33ddb6918446798830e128dc4cafb96119f29de91ac6bf94f22 - original: nightly-2019-02-11