From 4d15bcef8e4cdcaf15a558760ec93538f767abd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 09:43:18 +0200 Subject: [PATCH 01/31] Update Stack LTS to 19.33 (GHC 9.0.2) --- stack.yaml | 4 +--- stack.yaml.lock | 21 +++++++-------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/stack.yaml b/stack.yaml index 37058bc..0d07b5d 100644 --- a/stack.yaml +++ b/stack.yaml @@ -20,7 +20,7 @@ # NOTE: If you modify this field, make sure to update the tested-with # field in package.yaml to contain the corresponding GHC versions. -resolver: nightly-2022-01-04 +resolver: lts-19.33 # User packages to be built. # Various formats can be used as shown in the example below. @@ -43,8 +43,6 @@ packages: # - git: https://github.com/commercialhaskell/stack.git # commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a # -extra-deps: - - path-0.9.2 # Override default flag values for local packages and extra-deps # flags: {} diff --git a/stack.yaml.lock b/stack.yaml.lock index 1f2ae92..53255a7 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -1,19 +1,12 @@ # 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 +# https://docs.haskellstack.org/en/stable/topics/lock_files +packages: [] snapshots: -- original: nightly-2022-01-04 - completed: - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2022/1/4.yaml - sha256: ea584edfba307b5a88b51fc1db7c0c1b7da5f714fd30d69699fc78e3e1ce5212 - size: 623654 -packages: -- original: - hackage: path-0.9.2 - completed: - pantry-tree: - sha256: 2acf94a62daeeb0aee9b77d044ece55b5e03445b574e6980a2e84a5a514f5517 - size: 1206 - hackage: path-0.9.2@sha256:2f2a7f01737cd350b30381b619e1a862601c83f10ede4d6935f76f66e63ae0c7,3273 +- completed: + sha256: 6d1532d40621957a25bad5195bfca7938e8a06d923c91bc52aa0f3c41181f2d4 + size: 619204 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/33.yaml + original: lts-19.33 From 286bfbe8cc31d767bce09a309600545e8240394d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 10:10:27 +0200 Subject: [PATCH 02/31] Update version bounds to reflect LTS --- .github/workflows/ci.yaml | 2 +- package.yaml | 6 +++--- strong-path.cabal | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c3ee9c1..01d14ba 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -44,7 +44,7 @@ jobs: # If you change it, make sure to adjust lower bounds there to reflect the change. # Also, make sure to adjust tested-with field in package.yaml so that it contains # corresponding GHC version. - stack-resolver: lts-18.21 + stack-resolver: lts-19.33 steps: - name: Checkout the repo diff --git a/package.yaml b/package.yaml index 604bdd2..f0ea343 100644 --- a/package.yaml +++ b/package.yaml @@ -35,7 +35,7 @@ library: - path >=0.9.2 && <0.10 - exceptions >=0.10 && <0.11 - filepath >=1.4 && <1.5 - - template-haskell >=2.16 && <2.18 + - template-haskell >=2.17 && <2.18 - hashable >=1.3 && < 1.4 tests: @@ -52,7 +52,7 @@ tests: - filepath - hashable >=1.3 && < 1.4 - tasty >=1.4 && <1.5 - - tasty-hspec >=1.1 && <1.3 + - tasty-hspec >=1.2 && <1.3 - tasty-quickcheck >=0.10 && <0.11 - tasty-discover >=4.2 && <4.3 - - hspec >=2.7 && <2.10 + - hspec >=2.8 && <2.10 diff --git a/strong-path.cabal b/strong-path.cabal index 4ba168b..e7777d1 100644 --- a/strong-path.cabal +++ b/strong-path.cabal @@ -1,6 +1,6 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.4. +-- This file has been generated from package.yaml by hpack version 0.37.0. -- -- see: https://github.com/sol/hpack @@ -48,7 +48,7 @@ library , filepath ==1.4.* , hashable ==1.3.* , path >=0.9.2 && <0.10 - , template-haskell >=2.16 && <2.18 + , template-haskell ==2.17.* default-language: Haskell2010 test-suite strong-path-test @@ -71,11 +71,11 @@ test-suite strong-path-test base >=4.7 && <5 , filepath , hashable ==1.3.* - , hspec >=2.7 && <2.10 + , hspec >=2.8 && <2.10 , path , strong-path , tasty ==1.4.* , tasty-discover ==4.2.* - , tasty-hspec >=1.1 && <1.3 + , tasty-hspec ==1.2.* , tasty-quickcheck ==0.10.* default-language: Haskell2010 From 058fc0e6811f79c47d82addbb88e48323dcae6fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 10:34:09 +0200 Subject: [PATCH 03/31] Update Stack LTS to 20.44 (GHC 9.6.7) --- .github/workflows/ci.yaml | 2 +- package.yaml | 16 +++++++++------- stack.yaml | 2 +- stack.yaml.lock | 8 ++++---- strong-path.cabal | 12 ++++++------ 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 01d14ba..b940ff9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -44,7 +44,7 @@ jobs: # If you change it, make sure to adjust lower bounds there to reflect the change. # Also, make sure to adjust tested-with field in package.yaml so that it contains # corresponding GHC version. - stack-resolver: lts-19.33 + stack-resolver: lts-22.44 steps: - name: Checkout the repo diff --git a/package.yaml b/package.yaml index f0ea343..95b6526 100644 --- a/package.yaml +++ b/package.yaml @@ -15,6 +15,7 @@ category: System, Filesystem, FilePath description: Replacement for a FilePath that enables you to handle filepaths in your code in a type-safe manner. You can specify at type level if they are relative, absolute, file, directory, posix, windows, and even to which file or directory they point to or are relative to. +# Todo figure out what to do with this tested-with: GHC == 8.10.7, GHC == 9.0.1 # lts-18.21, nightly-2022-01-04 dependencies: @@ -25,18 +26,19 @@ library: ghc-options: - -Wall dependencies: + # TODO: I set them both to the same version, figure out what do do # NOTE: Version bounds here and in tests are defined so that they cover the latest LTS snapshot - # (lts-18.21) (lower bounds) and the nightly snapshot defined in stack.yaml (upper bounds). + # (lts-22.44) (lower bounds) and the nightly snapshot defined in stack.yaml (upper bounds). # Those two are also tested in the CI, and corresponding GHC versions are mentioned above # in the tested-with field. # In case you decide to cover a different LTS with the lower bounds, # make sure to also update the CI to use the correct LTS for testing and also update # tested-with field above. - - path >=0.9.2 && <0.10 + - path >=0.9.5 && <0.10 - exceptions >=0.10 && <0.11 - filepath >=1.4 && <1.5 - - template-haskell >=2.17 && <2.18 - - hashable >=1.3 && < 1.4 + - template-haskell >=2.20 && <2.21 + - hashable >=1.4 && < 1.5 tests: strong-path-test: @@ -50,9 +52,9 @@ tests: - strong-path - path - filepath - - hashable >=1.3 && < 1.4 + - hashable >=1.4 && < 1.5 - tasty >=1.4 && <1.5 - tasty-hspec >=1.2 && <1.3 - tasty-quickcheck >=0.10 && <0.11 - - tasty-discover >=4.2 && <4.3 - - hspec >=2.8 && <2.10 + - tasty-discover >=5.0 && <5.1 + - hspec >=2.11 && <2.12 diff --git a/stack.yaml b/stack.yaml index 0d07b5d..d4607d6 100644 --- a/stack.yaml +++ b/stack.yaml @@ -20,7 +20,7 @@ # NOTE: If you modify this field, make sure to update the tested-with # field in package.yaml to contain the corresponding GHC versions. -resolver: lts-19.33 +resolver: lts-22.44 # User packages to be built. # Various formats can be used as shown in the example below. diff --git a/stack.yaml.lock b/stack.yaml.lock index 53255a7..8d134eb 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -6,7 +6,7 @@ packages: [] snapshots: - completed: - sha256: 6d1532d40621957a25bad5195bfca7938e8a06d923c91bc52aa0f3c41181f2d4 - size: 619204 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/33.yaml - original: lts-19.33 + sha256: 238fa745b64f91184f9aa518fe04bdde6552533d169b0da5256670df83a0f1a9 + size: 721141 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/44.yaml + original: lts-22.44 diff --git a/strong-path.cabal b/strong-path.cabal index e7777d1..23f68cf 100644 --- a/strong-path.cabal +++ b/strong-path.cabal @@ -46,9 +46,9 @@ library base >=4.7 && <5 , exceptions ==0.10.* , filepath ==1.4.* - , hashable ==1.3.* - , path >=0.9.2 && <0.10 - , template-haskell ==2.17.* + , hashable ==1.4.* + , path >=0.9.5 && <0.10 + , template-haskell ==2.20.* default-language: Haskell2010 test-suite strong-path-test @@ -70,12 +70,12 @@ test-suite strong-path-test build-depends: base >=4.7 && <5 , filepath - , hashable ==1.3.* - , hspec >=2.8 && <2.10 + , hashable ==1.4.* + , hspec ==2.11.* , path , strong-path , tasty ==1.4.* - , tasty-discover ==4.2.* + , tasty-discover ==5.0.* , tasty-hspec ==1.2.* , tasty-quickcheck ==0.10.* default-language: Haskell2010 From 8704a6cb5c3b996e4b997e90ebc9b6b955080a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 10:37:24 +0200 Subject: [PATCH 04/31] Update cache action version --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 01d14ba..70bee72 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,7 +51,7 @@ jobs: uses: actions/checkout@v2 - name: Cache (Unix) - uses: actions/cache@v2 + uses: actions/cache@v4 if: runner.os == 'Linux' || runner.os == 'macOS' with: path: | From 121637157334ecefef663f2e7c4f3ccc828ee22b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 10:40:58 +0200 Subject: [PATCH 05/31] Update another occurence of actions/cache --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 70bee72..d9153fc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -77,7 +77,7 @@ jobs: restore-keys: | haskell-${{ runner.os }}-${{ hashFiles('stack.yaml') }}- - name: Cache (Windows) - uses: actions/cache@v2 + uses: actions/cache@v4 if: runner.os == 'Windows' with: # C\:sr is where stack installs compiled dependencies. From 2cf9603b3a23c5a797ec5adac6bbb9a24f987cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 10:55:14 +0200 Subject: [PATCH 06/31] Update tested-with field --- package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.yaml b/package.yaml index f0ea343..f1a9ef2 100644 --- a/package.yaml +++ b/package.yaml @@ -15,7 +15,7 @@ category: System, Filesystem, FilePath description: Replacement for a FilePath that enables you to handle filepaths in your code in a type-safe manner. You can specify at type level if they are relative, absolute, file, directory, posix, windows, and even to which file or directory they point to or are relative to. -tested-with: GHC == 8.10.7, GHC == 9.0.1 # lts-18.21, nightly-2022-01-04 +tested-with: GHC == 9.0.2 # lts-19.33 dependencies: - base >= 4.7 && < 5 From 0b4cf950be72311cfeb4ee83b7787849cc7196b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 14:29:39 +0200 Subject: [PATCH 07/31] Update github action --- .github/workflows/ci.yaml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d9153fc..d3ab813 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,20 +5,15 @@ on: pull_request: { branches: [main] } create: { tags: [v*] } +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + defaults: run: shell: bash jobs: - cancel: - name: Cancel redundant actions already in progress - runs-on: ubuntu-latest - steps: - - name: Cancel actions in progress of same workflow and same branch - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - # Check that Haskell code is formatted. code-formatter: runs-on: ubuntu-latest @@ -48,7 +43,7 @@ jobs: steps: - name: Checkout the repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache (Unix) uses: actions/cache@v4 @@ -134,10 +129,10 @@ jobs: stack path --stack-root stack ghc -- --version ghc --version - - - name: Build dependencies + + - name: Build dependencies run: stack --install-ghc test --only-dependencies - + - name: Build StrongPath & Run tests run: stack test From 3411d89f976fa083f818ef69f2e10f34d21118f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 14:30:09 +0200 Subject: [PATCH 08/31] Disable fail fast in GitHub action --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d3ab813..d4a4a12 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,6 +26,7 @@ jobs: runs-on: ${{ matrix.os }} needs: code-formatter strategy: + fail-fast: false matrix: os: - ubuntu-latest From 33161c71c0d3d998875249427ea8e322a1db2b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 17:26:06 +0200 Subject: [PATCH 09/31] Trigger CI --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d4a4a12..f8bffdb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -40,7 +40,7 @@ jobs: # If you change it, make sure to adjust lower bounds there to reflect the change. # Also, make sure to adjust tested-with field in package.yaml so that it contains # corresponding GHC version. - stack-resolver: lts-19.33 + stack-resolver: lts-19.33 steps: - name: Checkout the repo From 6af939b9ea4f6d82ccb63b77778f8c7e92b8398d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 17:27:34 +0200 Subject: [PATCH 10/31] Use native setup haskell action --- .github/workflows/ci.yaml | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f8bffdb..fab8dc0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -94,29 +94,29 @@ jobs: # We are setting up haskell via ghcup instead of using haskell/actions/setup # because the mentioned gh action can be months late with the latest versions # of Stack. - - name: Set up Haskell (Stack) via ghcup (Unix) - if: runner.os == 'Linux' || runner.os == 'macOS' - run: | - export BOOTSTRAP_HASKELL_NONINTERACTIVE=1 - export BOOTSTRAP_HASKELL_INSTALL_STACK=1 - curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh - - - name: Set up Haskell (Stack) via ghcup (Win) - if: runner.os == 'Windows' - run: | - Set-ExecutionPolicy Bypass -Scope Process -Force - [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 - Invoke-Command -ScriptBlock ([ScriptBlock]::Create(".{$(Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing)} -InstallStack")) - shell: powershell + # - name: Set up Haskell (Stack) via ghcup (Unix) + # if: runner.os == 'Linux' || runner.os == 'macOS' + # run: | + # export BOOTSTRAP_HASKELL_NONINTERACTIVE=1 + # export BOOTSTRAP_HASKELL_INSTALL_STACK=1 + # curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh + # + # - name: Set up Haskell (Stack) via ghcup (Win) + # if: runner.os == 'Windows' + # run: | + # Set-ExecutionPolicy Bypass -Scope Process -Force + # [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 + # Invoke-Command -ScriptBlock ([ScriptBlock]::Create(".{$(Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing)} -InstallStack")) + # shell: powershell # NOTE: I commented out this in favor of manual setup above, since with this action we # couldn't get the latest version of Stack. - # - name: Set up Haskell (Stack) - # uses: haskell/actions/setup@v1 - # with: - # ghc-version: latest - # enable-stack: true - # stack-version: latest + - name: Set up Haskell (Stack) + uses: haskell/actions/setup@v1 + with: + ghc-version: latest + enable-stack: true + stack-version: latest - name: Set Stack resolver if: matrix.stack-resolver != 'from-stack-yaml' From b2427a36da34fb35327bd6db28bf288ef30d5e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 17:31:36 +0200 Subject: [PATCH 11/31] Update cabal version --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fab8dc0..513be76 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -115,6 +115,7 @@ jobs: uses: haskell/actions/setup@v1 with: ghc-version: latest + cabal-version: "3.12.1.0" enable-stack: true stack-version: latest From 2dec50c5132265555fdb8908e9fc08878b08cdf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 17:36:22 +0200 Subject: [PATCH 12/31] Update setup haskell action --- .github/workflows/ci.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 513be76..cdc0e14 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -111,11 +111,9 @@ jobs: # NOTE: I commented out this in favor of manual setup above, since with this action we # couldn't get the latest version of Stack. - - name: Set up Haskell (Stack) - uses: haskell/actions/setup@v1 + - uses: haskell-actions/setup@v2 with: ghc-version: latest - cabal-version: "3.12.1.0" enable-stack: true stack-version: latest From c01025b99a22f1c181db4988f0860260dffb09e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 17:57:03 +0200 Subject: [PATCH 13/31] Update GHC to 9.4.5 --- package.yaml | 6 +++--- stack.yaml | 2 +- stack.yaml.lock | 8 ++++---- strong-path.cabal | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.yaml b/package.yaml index d98aac1..df8fd46 100644 --- a/package.yaml +++ b/package.yaml @@ -33,10 +33,10 @@ library: # In case you decide to cover a different LTS with the lower bounds, # make sure to also update the CI to use the correct LTS for testing and also update # tested-with field above. - - path >=0.9.5 && <0.10 + - path >=0.9.2 && <0.10 - exceptions >=0.10 && <0.11 - filepath >=1.4 && <1.5 - - template-haskell >=2.20 && <2.21 + - template-haskell >=2.19 && <2.21 - hashable >=1.4 && < 1.5 tests: @@ -56,4 +56,4 @@ tests: - tasty-hspec >=1.2 && <1.3 - tasty-quickcheck >=0.10 && <0.11 - tasty-discover >=5.0 && <5.1 - - hspec >=2.11 && <2.12 + - hspec >=2.10 && <2.12 diff --git a/stack.yaml b/stack.yaml index d4607d6..9930fd6 100644 --- a/stack.yaml +++ b/stack.yaml @@ -20,7 +20,7 @@ # NOTE: If you modify this field, make sure to update the tested-with # field in package.yaml to contain the corresponding GHC versions. -resolver: lts-22.44 +resolver: lts-21.7 # User packages to be built. # Various formats can be used as shown in the example below. diff --git a/stack.yaml.lock b/stack.yaml.lock index 8d134eb..08d64d7 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -6,7 +6,7 @@ packages: [] snapshots: - completed: - sha256: 238fa745b64f91184f9aa518fe04bdde6552533d169b0da5256670df83a0f1a9 - size: 721141 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/44.yaml - original: lts-22.44 + sha256: 23bb9bb355bfdb1635252e120a29b712f0d5e8a6c6a65c5ab5bd6692f46c438e + size: 640457 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/7.yaml + original: lts-21.7 diff --git a/strong-path.cabal b/strong-path.cabal index 23f68cf..2a194e2 100644 --- a/strong-path.cabal +++ b/strong-path.cabal @@ -18,7 +18,7 @@ license: MIT license-file: LICENSE build-type: Simple tested-with: - GHC == 8.10.7, GHC == 9.0.1 + GHC == 9.0.2 extra-source-files: README.md ChangeLog.md @@ -47,8 +47,8 @@ library , exceptions ==0.10.* , filepath ==1.4.* , hashable ==1.4.* - , path >=0.9.5 && <0.10 - , template-haskell ==2.20.* + , path >=0.9.2 && <0.10 + , template-haskell >=2.19 && <2.21 default-language: Haskell2010 test-suite strong-path-test @@ -71,7 +71,7 @@ test-suite strong-path-test base >=4.7 && <5 , filepath , hashable ==1.4.* - , hspec ==2.11.* + , hspec >=2.10 && <2.12 , path , strong-path , tasty ==1.4.* From 5809eda067e5ee89f686e24c6c45ea1f0824fa1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 18:00:59 +0200 Subject: [PATCH 14/31] Trigger CI From 1dcb30a69fb860ea2ae12e173486f6c12a79863e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 18:01:54 +0200 Subject: [PATCH 15/31] Change version to trigger CI --- stack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack.yaml b/stack.yaml index 9930fd6..d4607d6 100644 --- a/stack.yaml +++ b/stack.yaml @@ -20,7 +20,7 @@ # NOTE: If you modify this field, make sure to update the tested-with # field in package.yaml to contain the corresponding GHC versions. -resolver: lts-21.7 +resolver: lts-22.44 # User packages to be built. # Various formats can be used as shown in the example below. From 929d766f4d73b66186d938412f8f322157102e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 10 Oct 2025 18:03:52 +0200 Subject: [PATCH 16/31] Solve merge conflict --- .github/workflows/ci.yaml | 6 +----- stack.yaml | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1c1c986..6d023cf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -40,11 +40,7 @@ jobs: # If you change it, make sure to adjust lower bounds there to reflect the change. # Also, make sure to adjust tested-with field in package.yaml so that it contains # corresponding GHC version. -<<<<<<< HEAD - stack-resolver: lts-22.44 -======= - stack-resolver: lts-19.33 ->>>>>>> @{-1} + stack-resolver: lts-21.7 steps: - name: Checkout the repo diff --git a/stack.yaml b/stack.yaml index d4607d6..9930fd6 100644 --- a/stack.yaml +++ b/stack.yaml @@ -20,7 +20,7 @@ # NOTE: If you modify this field, make sure to update the tested-with # field in package.yaml to contain the corresponding GHC versions. -resolver: lts-22.44 +resolver: lts-21.7 # User packages to be built. # Various formats can be used as shown in the example below. From 16570030aba43ee544964b36a1ceeeef58e1a3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Wed, 29 Oct 2025 10:25:27 +0100 Subject: [PATCH 17/31] Handle empty file paths in test utils --- test/Test/Utils.hs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/test/Test/Utils.hs b/test/Test/Utils.hs index 4c761ab..e80ecc7 100644 --- a/test/Test/Utils.hs +++ b/test/Test/Utils.hs @@ -13,16 +13,18 @@ systemFpRoot = if FP.pathSeparator == '\\' then "C:\\" else "/" -- | Takes posix path and converts it into windows path if running on Windows or leaves as it is if on Unix. posixToSystemFp :: FilePath -> FilePath -posixToSystemFp posixFp = maybeSystemRoot ++ systemFpRootless - where - maybeSystemRoot = if head posixFp == '/' then systemFpRoot else "" - posixFpRootless = if head posixFp == '/' then tail posixFp else posixFp - systemFpRootless = map (\c -> if c == '/' then FP.pathSeparator else c) posixFpRootless +posixToSystemFp = convertPosixPath systemFpRoot FP.pathSeparator -- | Takes posix path and converts it into windows path. posixToWindowsFp :: FilePath -> FilePath -posixToWindowsFp posixFp = maybeWinRoot ++ winFpRootless +posixToWindowsFp = convertPosixPath "C:\\" FPW.pathSeparator + +convertPosixPath :: FilePath -> Char -> FilePath -> FilePath +convertPosixPath rootReplacement separator posixFp = + case posixFp of + "" -> "" + '/' : rest -> rootReplacement ++ map convertSeparator rest + _ -> map convertSeparator posixFp where - maybeWinRoot = if head posixFp == '/' then "C:\\" else "" - posixFpRootless = if head posixFp == '/' then tail posixFp else posixFp - winFpRootless = map (\c -> if c == '/' then FPW.pathSeparator else c) posixFpRootless + convertSeparator '/' = separator + convertSeparator c = c From de6205403c86a7ce8306969dca8777133c7427dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Wed, 29 Oct 2025 10:26:19 +0100 Subject: [PATCH 18/31] Be explicit about impossible cases in path concat operator --- src/StrongPath/Operations.hs | 64 +++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/src/StrongPath/Operations.hs b/src/StrongPath/Operations.hs index ccefc14..a150643 100644 --- a/src/StrongPath/Operations.hs +++ b/src/StrongPath/Operations.hs @@ -105,43 +105,55 @@ parent path = case path of () :: Path s b (Dir d) -> Path s (Rel d) t -> Path s b t ---- System lsp@(RelDir _ _) (RelFile rp rprefix) = - let (RelDir lp' lprefix') = iterate parent lsp !! prefixNumParentDirs rprefix - in RelFile (lp' P. rp) lprefix' + case iterate parent lsp !! prefixNumParentDirs rprefix of + (RelDir lp' lprefix') -> RelFile (lp' P. rp) lprefix' + _ -> impossible lsp@(RelDir _ _) (RelDir rp rprefix) = - let (RelDir lp' lprefix') = iterate parent lsp !! prefixNumParentDirs rprefix - in RelDir (lp' P. rp) lprefix' + case iterate parent lsp !! prefixNumParentDirs rprefix of + (RelDir lp' lprefix') -> RelDir (lp' P. rp) lprefix' + _ -> impossible lsp@(AbsDir _) (RelFile rp rprefix) = - let (AbsDir lp') = iterate parent lsp !! prefixNumParentDirs rprefix - in AbsFile (lp' P. rp) + case iterate parent lsp !! prefixNumParentDirs rprefix of + (AbsDir lp') -> AbsFile (lp' P. rp) + _ -> impossible lsp@(AbsDir _) (RelDir rp rprefix) = - let (AbsDir lp') = iterate parent lsp !! prefixNumParentDirs rprefix - in AbsDir (lp' P. rp) + case iterate parent lsp !! prefixNumParentDirs rprefix of + (AbsDir lp') -> AbsDir (lp' P. rp) + _ -> impossible ---- Windows lsp@(RelDirW _ _) (RelFileW rp rprefix) = - let (RelDirW lp' lprefix') = iterate parent lsp !! prefixNumParentDirs rprefix - in RelFileW (lp' PW. rp) lprefix' + case iterate parent lsp !! prefixNumParentDirs rprefix of + (RelDirW lp' lprefix') -> RelFileW (lp' PW. rp) lprefix' + _ -> impossible lsp@(RelDirW _ _) (RelDirW rp rprefix) = - let (RelDirW lp' lprefix') = iterate parent lsp !! prefixNumParentDirs rprefix - in RelDirW (lp' PW. rp) lprefix' + case iterate parent lsp !! prefixNumParentDirs rprefix of + (RelDirW lp' lprefix') -> RelDirW (lp' PW. rp) lprefix' + _ -> impossible lsp@(AbsDirW _) (RelFileW rp rprefix) = - let (AbsDirW lp') = iterate parent lsp !! prefixNumParentDirs rprefix - in AbsFileW (lp' PW. rp) + case iterate parent lsp !! prefixNumParentDirs rprefix of + (AbsDirW lp') -> AbsFileW (lp' PW. rp) + _ -> impossible lsp@(AbsDirW _) (RelDirW rp rprefix) = - let (AbsDirW lp') = iterate parent lsp !! prefixNumParentDirs rprefix - in AbsDirW (lp' PW. rp) + case iterate parent lsp !! prefixNumParentDirs rprefix of + (AbsDirW lp') -> AbsDirW (lp' PW. rp) + _ -> impossible ---- Posix lsp@(RelDirP _ _) (RelFileP rp rprefix) = - let (RelDirP lp' lprefix') = iterate parent lsp !! prefixNumParentDirs rprefix - in RelFileP (lp' PP. rp) lprefix' + case iterate parent lsp !! prefixNumParentDirs rprefix of + (RelDirP lp' lprefix') -> RelFileP (lp' PP. rp) lprefix' + _ -> impossible lsp@(RelDirP _ _) (RelDirP rp rprefix) = - let (RelDirP lp' lprefix') = iterate parent lsp !! prefixNumParentDirs rprefix - in RelDirP (lp' PP. rp) lprefix' + case iterate parent lsp !! prefixNumParentDirs rprefix of + (RelDirP lp' lprefix') -> RelDirP (lp' PP. rp) lprefix' + _ -> impossible lsp@(AbsDirP _) (RelFileP rp rprefix) = - let (AbsDirP lp') = iterate parent lsp !! prefixNumParentDirs rprefix - in AbsFileP (lp' PP. rp) + case iterate parent lsp !! prefixNumParentDirs rprefix of + (AbsDirP lp') -> AbsFileP (lp' PP. rp) + _ -> impossible lsp@(AbsDirP _) (RelDirP rp rprefix) = - let (AbsDirP lp') = iterate parent lsp !! prefixNumParentDirs rprefix - in AbsDirP (lp' PP. rp) + case iterate parent lsp !! prefixNumParentDirs rprefix of + (AbsDirP lp') -> AbsDirP (lp' PP. rp) + _ -> impossible _ _ = impossible -- | Returns the most right member of the path once split by separators. @@ -233,7 +245,7 @@ castFile _ = impossible -- Works well for \"normal\" relative paths like @\"a\\b\\c\"@ (Win) or @\"a\/b\/c\"@ (Posix). -- If path is weird but still considered relative, like just @\"C:\"@ on Win, -- results can be unexpected, most likely resulting with error thrown. -relDirToPosix :: MonadThrow m => Path s (Rel d1) (Dir d2) -> m (Path Posix (Rel d1) (Dir d2)) +relDirToPosix :: (MonadThrow m) => Path s (Rel d1) (Dir d2) -> m (Path Posix (Rel d1) (Dir d2)) relDirToPosix sp@(RelDir _ _) = parseRelDirP $ FPP.joinPath $ FP.splitDirectories $ toFilePath sp relDirToPosix sp@(RelDirW _ _) = parseRelDirP $ FPP.joinPath $ FPW.splitDirectories $ toFilePath sp relDirToPosix (RelDirP p pr) = return $ RelDirP p pr @@ -241,7 +253,7 @@ relDirToPosix _ = impossible -- | Converts relative file path to posix, if it is not already posix. -- Check 'relDirToPosix' for more details, they behave the same. -relFileToPosix :: MonadThrow m => Path s (Rel d1) (File f) -> m (Path Posix (Rel d1) (File f)) +relFileToPosix :: (MonadThrow m) => Path s (Rel d1) (File f) -> m (Path Posix (Rel d1) (File f)) relFileToPosix sp@(RelFile _ _) = parseRelFileP $ FPP.joinPath $ FP.splitDirectories $ toFilePath sp relFileToPosix sp@(RelFileW _ _) = parseRelFileP $ FPP.joinPath $ FPW.splitDirectories $ toFilePath sp relFileToPosix (RelFileP p pr) = return $ RelFileP p pr From 2aaf4707bb28ef347d20d0cda6a7ad809291b70e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Wed, 29 Oct 2025 10:33:33 +0100 Subject: [PATCH 19/31] Set version bounds and test range from GHC 9.4.5 to GHC 9.12.2 --- package.yaml | 22 +++++++++++----------- stack.yaml | 2 +- stack.yaml.lock | 8 ++++---- strong-path.cabal | 22 +++++++++++----------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/package.yaml b/package.yaml index df8fd46..4614cd5 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: strong-path -version: 1.1.4.0 +version: 1.2.0.0 github: "wasp-lang/strong-path" license: MIT author: "Martin Sosic" @@ -15,10 +15,10 @@ category: System, Filesystem, FilePath description: Replacement for a FilePath that enables you to handle filepaths in your code in a type-safe manner. You can specify at type level if they are relative, absolute, file, directory, posix, windows, and even to which file or directory they point to or are relative to. -tested-with: GHC == 9.0.2 # lts-19.33 +tested-with: GHC == 9.4.5, GHC == 9.12.2 # lts-19.33, nightly-2025-10-29 dependencies: - - base >= 4.7 && < 5 + - base >= 4.17 && < 5 library: source-dirs: src @@ -27,7 +27,7 @@ library: dependencies: # TODO: I set them both to the same version, figure out what do do # NOTE: Version bounds here and in tests are defined so that they cover the latest LTS snapshot - # (lts-22.44) (lower bounds) and the nightly snapshot defined in stack.yaml (upper bounds). + # (lts-21.7) (lower bounds) and the nightly snapshot defined in stack.yaml (upper bounds). # Those two are also tested in the CI, and corresponding GHC versions are mentioned above # in the tested-with field. # In case you decide to cover a different LTS with the lower bounds, @@ -35,9 +35,9 @@ library: # tested-with field above. - path >=0.9.2 && <0.10 - exceptions >=0.10 && <0.11 - - filepath >=1.4 && <1.5 - - template-haskell >=2.19 && <2.21 - - hashable >=1.4 && < 1.5 + - filepath >=1.4 && <1.6 + - template-haskell >=2.19 && <2.24 + - hashable >=1.4 && < 1.6 tests: strong-path-test: @@ -51,9 +51,9 @@ tests: - strong-path - path - filepath - - hashable >=1.4 && < 1.5 - - tasty >=1.4 && <1.5 + - hashable + - tasty >=1.4 && <1.6 - tasty-hspec >=1.2 && <1.3 - - tasty-quickcheck >=0.10 && <0.11 - - tasty-discover >=5.0 && <5.1 + - tasty-quickcheck >=0.10 && <0.12 + - tasty-discover >=5.0 && <5.3 - hspec >=2.10 && <2.12 diff --git a/stack.yaml b/stack.yaml index 9930fd6..ff5e256 100644 --- a/stack.yaml +++ b/stack.yaml @@ -20,7 +20,7 @@ # NOTE: If you modify this field, make sure to update the tested-with # field in package.yaml to contain the corresponding GHC versions. -resolver: lts-21.7 +resolver: nightly-2025-10-29 # User packages to be built. # Various formats can be used as shown in the example below. diff --git a/stack.yaml.lock b/stack.yaml.lock index 08d64d7..5bf52af 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -6,7 +6,7 @@ packages: [] snapshots: - completed: - sha256: 23bb9bb355bfdb1635252e120a29b712f0d5e8a6c6a65c5ab5bd6692f46c438e - size: 640457 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/7.yaml - original: lts-21.7 + sha256: e527e879a59ab8d2408960c7da3e2fc5edf4fb433a0f2fe65f0c79736f2e10e8 + size: 705114 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2025/10/29.yaml + original: nightly-2025-10-29 diff --git a/strong-path.cabal b/strong-path.cabal index 2a194e2..67c498b 100644 --- a/strong-path.cabal +++ b/strong-path.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: strong-path -version: 1.1.4.0 +version: 1.2.0.0 synopsis: Strongly typed paths in Haskell. description: Replacement for a FilePath that enables you to handle filepaths in your code in a type-safe manner. You can specify at type level if they are relative, absolute, file, directory, posix, windows, and even to which file or directory they point to or are relative to. category: System, Filesystem, FilePath @@ -18,7 +18,7 @@ license: MIT license-file: LICENSE build-type: Simple tested-with: - GHC == 9.0.2 + GHC == 9.4.5, GHC == 9.12.2 extra-source-files: README.md ChangeLog.md @@ -43,12 +43,12 @@ library src ghc-options: -Wall build-depends: - base >=4.7 && <5 + base >=4.17 && <5 , exceptions ==0.10.* - , filepath ==1.4.* - , hashable ==1.4.* + , filepath >=1.4 && <1.6 + , hashable >=1.4 && <1.6 , path >=0.9.2 && <0.10 - , template-haskell >=2.19 && <2.21 + , template-haskell >=2.19 && <2.24 default-language: Haskell2010 test-suite strong-path-test @@ -68,14 +68,14 @@ test-suite strong-path-test test ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: - base >=4.7 && <5 + base >=4.17 && <5 , filepath - , hashable ==1.4.* + , hashable , hspec >=2.10 && <2.12 , path , strong-path - , tasty ==1.4.* - , tasty-discover ==5.0.* + , tasty >=1.4 && <1.6 + , tasty-discover >=5.0 && <5.3 , tasty-hspec ==1.2.* - , tasty-quickcheck ==0.10.* + , tasty-quickcheck >=0.10 && <0.12 default-language: Haskell2010 From 7a5fe5b1f67e1a241eaec878733635cc773e371b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Wed, 29 Oct 2025 10:45:25 +0100 Subject: [PATCH 20/31] Fix lower bound version typo --- package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.yaml b/package.yaml index 4614cd5..2fd7d5c 100644 --- a/package.yaml +++ b/package.yaml @@ -15,7 +15,7 @@ category: System, Filesystem, FilePath description: Replacement for a FilePath that enables you to handle filepaths in your code in a type-safe manner. You can specify at type level if they are relative, absolute, file, directory, posix, windows, and even to which file or directory they point to or are relative to. -tested-with: GHC == 9.4.5, GHC == 9.12.2 # lts-19.33, nightly-2025-10-29 +tested-with: GHC == 9.4.5, GHC == 9.12.2 # lts-21.7, nightly-2025-10-29 dependencies: - base >= 4.17 && < 5 From 02680119a7886d9d893834ba7e409aceb30b7d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Wed, 29 Oct 2025 10:56:09 +0100 Subject: [PATCH 21/31] Remove manual stack installation --- .github/workflows/ci.yaml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6d023cf..6a2dde4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -91,26 +91,6 @@ jobs: if: runner.os == 'macOS' run: rm -rf ~/.stack/setup-exe-cache - # We are setting up haskell via ghcup instead of using haskell/actions/setup - # because the mentioned gh action can be months late with the latest versions - # of Stack. - # - name: Set up Haskell (Stack) via ghcup (Unix) - # if: runner.os == 'Linux' || runner.os == 'macOS' - # run: | - # export BOOTSTRAP_HASKELL_NONINTERACTIVE=1 - # export BOOTSTRAP_HASKELL_INSTALL_STACK=1 - # curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh - # - # - name: Set up Haskell (Stack) via ghcup (Win) - # if: runner.os == 'Windows' - # run: | - # Set-ExecutionPolicy Bypass -Scope Process -Force - # [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 - # Invoke-Command -ScriptBlock ([ScriptBlock]::Create(".{$(Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing)} -InstallStack")) - # shell: powershell - - # NOTE: I commented out this in favor of manual setup above, since with this action we - # couldn't get the latest version of Stack. - uses: haskell-actions/setup@v2 with: ghc-version: latest From a707a42f2622ee48843c7ead48dcbc0e858a6ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Wed, 29 Oct 2025 11:18:03 +0100 Subject: [PATCH 22/31] Remove todo --- package.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/package.yaml b/package.yaml index 2fd7d5c..64f0a6a 100644 --- a/package.yaml +++ b/package.yaml @@ -25,7 +25,6 @@ library: ghc-options: - -Wall dependencies: - # TODO: I set them both to the same version, figure out what do do # NOTE: Version bounds here and in tests are defined so that they cover the latest LTS snapshot # (lts-21.7) (lower bounds) and the nightly snapshot defined in stack.yaml (upper bounds). # Those two are also tested in the CI, and corresponding GHC versions are mentioned above From 7bce43ccf745d3a1382197d08a70d5babdf2fb5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Wed, 29 Oct 2025 17:13:03 +0100 Subject: [PATCH 23/31] Extend lower supported range to GHC 9.0.2 --- .github/workflows/ci.yaml | 2 +- package.yaml | 10 +++++----- strong-path.cabal | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6a2dde4..46bb6cb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -40,7 +40,7 @@ jobs: # If you change it, make sure to adjust lower bounds there to reflect the change. # Also, make sure to adjust tested-with field in package.yaml so that it contains # corresponding GHC version. - stack-resolver: lts-21.7 + stack-resolver: lts-19.33 steps: - name: Checkout the repo diff --git a/package.yaml b/package.yaml index 64f0a6a..2f23bdb 100644 --- a/package.yaml +++ b/package.yaml @@ -18,7 +18,7 @@ description: Replacement for a FilePath that enables you to handle filep tested-with: GHC == 9.4.5, GHC == 9.12.2 # lts-21.7, nightly-2025-10-29 dependencies: - - base >= 4.17 && < 5 + - base >= 4.7 && < 5 library: source-dirs: src @@ -35,8 +35,8 @@ library: - path >=0.9.2 && <0.10 - exceptions >=0.10 && <0.11 - filepath >=1.4 && <1.6 - - template-haskell >=2.19 && <2.24 - - hashable >=1.4 && < 1.6 + - template-haskell >=2.17 && <2.24 + - hashable >=1.3 && < 1.6 tests: strong-path-test: @@ -54,5 +54,5 @@ tests: - tasty >=1.4 && <1.6 - tasty-hspec >=1.2 && <1.3 - tasty-quickcheck >=0.10 && <0.12 - - tasty-discover >=5.0 && <5.3 - - hspec >=2.10 && <2.12 + - tasty-discover >=4.2 && <5.3 + - hspec >=2.8 && <2.12 diff --git a/strong-path.cabal b/strong-path.cabal index 67c498b..cd4fe95 100644 --- a/strong-path.cabal +++ b/strong-path.cabal @@ -43,12 +43,12 @@ library src ghc-options: -Wall build-depends: - base >=4.17 && <5 + base >=4.7 && <5 , exceptions ==0.10.* , filepath >=1.4 && <1.6 - , hashable >=1.4 && <1.6 + , hashable >=1.3 && <1.6 , path >=0.9.2 && <0.10 - , template-haskell >=2.19 && <2.24 + , template-haskell >=2.17 && <2.24 default-language: Haskell2010 test-suite strong-path-test @@ -68,14 +68,14 @@ test-suite strong-path-test test ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: - base >=4.17 && <5 + base >=4.7 && <5 , filepath , hashable - , hspec >=2.10 && <2.12 + , hspec >=2.8 && <2.12 , path , strong-path , tasty >=1.4 && <1.6 - , tasty-discover >=5.0 && <5.3 + , tasty-discover >=4.2 && <5.3 , tasty-hspec ==1.2.* , tasty-quickcheck >=0.10 && <0.12 default-language: Haskell2010 From 77d84201ad549a2b2d93de065e7cbbe9e9c26dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Wed, 29 Oct 2025 17:16:57 +0100 Subject: [PATCH 24/31] Fix tested-with field --- package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.yaml b/package.yaml index 2f23bdb..5f7a3b3 100644 --- a/package.yaml +++ b/package.yaml @@ -15,7 +15,7 @@ category: System, Filesystem, FilePath description: Replacement for a FilePath that enables you to handle filepaths in your code in a type-safe manner. You can specify at type level if they are relative, absolute, file, directory, posix, windows, and even to which file or directory they point to or are relative to. -tested-with: GHC == 9.4.5, GHC == 9.12.2 # lts-21.7, nightly-2025-10-29 +tested-with: GHC == 9.0.2, GHC == 9.12.2 # lts-21.7, nightly-2025-10-29 dependencies: - base >= 4.7 && < 5 From 39ae48907a9ae93126537df5c6f31851318e6309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Wed, 29 Oct 2025 17:17:16 +0100 Subject: [PATCH 25/31] Fix comment next to tested-with --- package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.yaml b/package.yaml index 5f7a3b3..5c8dc44 100644 --- a/package.yaml +++ b/package.yaml @@ -15,7 +15,7 @@ category: System, Filesystem, FilePath description: Replacement for a FilePath that enables you to handle filepaths in your code in a type-safe manner. You can specify at type level if they are relative, absolute, file, directory, posix, windows, and even to which file or directory they point to or are relative to. -tested-with: GHC == 9.0.2, GHC == 9.12.2 # lts-21.7, nightly-2025-10-29 +tested-with: GHC == 9.0.2, GHC == 9.12.2 # lts-19.33, nightly-2025-10-29 dependencies: - base >= 4.7 && < 5 From 5ade54b0e65c1e775c1efae51107d77d643d9007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Wed, 29 Oct 2025 17:18:42 +0100 Subject: [PATCH 26/31] Fix comment --- package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.yaml b/package.yaml index 5c8dc44..f4a00ea 100644 --- a/package.yaml +++ b/package.yaml @@ -26,7 +26,7 @@ library: - -Wall dependencies: # NOTE: Version bounds here and in tests are defined so that they cover the latest LTS snapshot - # (lts-21.7) (lower bounds) and the nightly snapshot defined in stack.yaml (upper bounds). + # (lts-19.33) (lower bounds) and the nightly snapshot defined in stack.yaml (upper bounds). # Those two are also tested in the CI, and corresponding GHC versions are mentioned above # in the tested-with field. # In case you decide to cover a different LTS with the lower bounds, From 3b1abf3e77e74896696cbd3e2da36cb409884a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 31 Oct 2025 11:31:12 +0100 Subject: [PATCH 27/31] Refactor testing function --- test/Test/Utils.hs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/test/Test/Utils.hs b/test/Test/Utils.hs index e80ecc7..025d7be 100644 --- a/test/Test/Utils.hs +++ b/test/Test/Utils.hs @@ -13,18 +13,16 @@ systemFpRoot = if FP.pathSeparator == '\\' then "C:\\" else "/" -- | Takes posix path and converts it into windows path if running on Windows or leaves as it is if on Unix. posixToSystemFp :: FilePath -> FilePath -posixToSystemFp = convertPosixPath systemFpRoot FP.pathSeparator +posixToSystemFp = convertPosixFp systemFpRoot FP.pathSeparator -- | Takes posix path and converts it into windows path. posixToWindowsFp :: FilePath -> FilePath -posixToWindowsFp = convertPosixPath "C:\\" FPW.pathSeparator +posixToWindowsFp = convertPosixFp "C:\\" FPW.pathSeparator -convertPosixPath :: FilePath -> Char -> FilePath -> FilePath -convertPosixPath rootReplacement separator posixFp = +convertPosixFp :: FilePath -> Char -> FilePath -> FilePath +convertPosixFp newRoot newSeparator posixFp = case posixFp of - "" -> "" - '/' : rest -> rootReplacement ++ map convertSeparator rest - _ -> map convertSeparator posixFp - where - convertSeparator '/' = separator - convertSeparator c = c + "" -> error "Empty string is not a valid posix path." + '/' : restOfAbsPosixFp -> newRoot ++ map convertSeparator restOfAbsPosixFp + relPosixFp -> map convertSeparator relPosixFp + where convertSeparator c = if c == '/' then newSeparator else c From 4473715fe9a88ac04ba5cc5d8c8424e2f246ff40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 31 Oct 2025 11:31:28 +0100 Subject: [PATCH 28/31] Extract common dependencies --- package.yaml | 9 +++------ strong-path.cabal | 8 ++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/package.yaml b/package.yaml index f4a00ea..9a04848 100644 --- a/package.yaml +++ b/package.yaml @@ -19,6 +19,9 @@ tested-with: GHC == 9.0.2, GHC == 9.12.2 # lts-19.33, nightly-2025-10-29 dependencies: - base >= 4.7 && < 5 + - hashable >=1.3 && < 1.6 + - path >=0.9.2 && <0.10 + - filepath >=1.4 && <1.6 library: source-dirs: src @@ -32,11 +35,8 @@ library: # In case you decide to cover a different LTS with the lower bounds, # make sure to also update the CI to use the correct LTS for testing and also update # tested-with field above. - - path >=0.9.2 && <0.10 - exceptions >=0.10 && <0.11 - - filepath >=1.4 && <1.6 - template-haskell >=2.17 && <2.24 - - hashable >=1.3 && < 1.6 tests: strong-path-test: @@ -48,9 +48,6 @@ tests: - -with-rtsopts=-N dependencies: - strong-path - - path - - filepath - - hashable - tasty >=1.4 && <1.6 - tasty-hspec >=1.2 && <1.3 - tasty-quickcheck >=0.10 && <0.12 diff --git a/strong-path.cabal b/strong-path.cabal index cd4fe95..6be1577 100644 --- a/strong-path.cabal +++ b/strong-path.cabal @@ -18,7 +18,7 @@ license: MIT license-file: LICENSE build-type: Simple tested-with: - GHC == 9.4.5, GHC == 9.12.2 + GHC == 9.0.2, GHC == 9.12.2 extra-source-files: README.md ChangeLog.md @@ -69,10 +69,10 @@ test-suite strong-path-test ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: base >=4.7 && <5 - , filepath - , hashable + , filepath >=1.4 && <1.6 + , hashable >=1.3 && <1.6 , hspec >=2.8 && <2.12 - , path + , path >=0.9.2 && <0.10 , strong-path , tasty >=1.4 && <1.6 , tasty-discover >=4.2 && <5.3 From 6d63f23dd1202ba7c639f88108264269e0f0d2b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 31 Oct 2025 14:50:02 +0100 Subject: [PATCH 29/31] Update note on dependency versions --- package.yaml | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/package.yaml b/package.yaml index 9a04848..c921bc1 100644 --- a/package.yaml +++ b/package.yaml @@ -28,13 +28,36 @@ library: ghc-options: - -Wall dependencies: - # NOTE: Version bounds here and in tests are defined so that they cover the latest LTS snapshot - # (lts-19.33) (lower bounds) and the nightly snapshot defined in stack.yaml (upper bounds). - # Those two are also tested in the CI, and corresponding GHC versions are mentioned above - # in the tested-with field. - # In case you decide to cover a different LTS with the lower bounds, - # make sure to also update the CI to use the correct LTS for testing and also update - # tested-with field above. + # NOTE: Version bounds here and in tests are defined so that they cover the + # latest LTS snapshot (lts-19.33) (lower bounds) and the nightly snapshot + # defined in stack.yaml (upper bounds). We are ignoring the minor + # versions on the lower bound for better flexibility. + # + # Those two LTS snapshots are also tested in the CI, and corresponding + # GHC versions are mentioned above in the tested-with field. + # + # If you decide to cover a different LTS with the lower bounds, make sure + # to also update the CI to use the correct LTS for testing and also + # update tested-with field above. + # + # When doing a GHC update: + # - Read this to learn more about the process: + # https://github.com/wasp-lang/haskell-handbook/blob/master/dependencies-version-bounds.md + # - Ensure you don't leave a gap in supported GHC versions. Each GHC/base + # should have a version of StrongPath to go with it. + # - Go through the breaking changes version of all libraries that need to + # be bumped and double check they don't affect us. + # + # The current situation: + # - Lower bounds match GHC 9.0.2 (Stack's LTS 19.33, major digits only) + # - Upper bounds match GHC 9.12.2 (Stack's nightly-2025-10-29). The + # exclusive upper limit is set to the next breaking change version. + # + # For example: + # - `LTS 19.33` has the version of `filepath` set to `1.4.2.2` + # - `nighly-2025-10-29` says has a version of `filepath` set to `1.5.4.0` + # - Strong path requires `filepath >=1.4 && <1.6` + # - exceptions >=0.10 && <0.11 - template-haskell >=2.17 && <2.24 From 46a2c0fb1d54402827bedfae71202b895994e03a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 31 Oct 2025 15:05:51 +0100 Subject: [PATCH 30/31] Fix formatting --- test/Test/Utils.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Test/Utils.hs b/test/Test/Utils.hs index 025d7be..dc5d5db 100644 --- a/test/Test/Utils.hs +++ b/test/Test/Utils.hs @@ -25,4 +25,5 @@ convertPosixFp newRoot newSeparator posixFp = "" -> error "Empty string is not a valid posix path." '/' : restOfAbsPosixFp -> newRoot ++ map convertSeparator restOfAbsPosixFp relPosixFp -> map convertSeparator relPosixFp - where convertSeparator c = if c == '/' then newSeparator else c + where + convertSeparator c = if c == '/' then newSeparator else c From b265b7cb4afb65e71a006dee2bbbba93d3c6b872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Fri, 31 Oct 2025 15:27:07 +0100 Subject: [PATCH 31/31] Fix formatting --- test/StrongPath/InstanceTest.hs | 2 +- test/Test/Utils.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/StrongPath/InstanceTest.hs b/test/StrongPath/InstanceTest.hs index f9b3160..182ce33 100644 --- a/test/StrongPath/InstanceTest.hs +++ b/test/StrongPath/InstanceTest.hs @@ -27,4 +27,4 @@ test_StrongPathInstance = testSpec "StrongPath.Instance" $ do aPath <- parseRelDir "a" bPath <- parseRelDir "b" abPath <- parseRelDir "a/b" - sort [bPath, abPath, aPath] `shouldBe` [aPath, abPath, bPath] \ No newline at end of file + sort [bPath, abPath, aPath] `shouldBe` [aPath, abPath, bPath] diff --git a/test/Test/Utils.hs b/test/Test/Utils.hs index dc5d5db..a756317 100644 --- a/test/Test/Utils.hs +++ b/test/Test/Utils.hs @@ -25,5 +25,5 @@ convertPosixFp newRoot newSeparator posixFp = "" -> error "Empty string is not a valid posix path." '/' : restOfAbsPosixFp -> newRoot ++ map convertSeparator restOfAbsPosixFp relPosixFp -> map convertSeparator relPosixFp - where + where convertSeparator c = if c == '/' then newSeparator else c