Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support AbstractFilePath #192

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
a266326
Removed .ghci file
mmhat Jun 18, 2024
23afae1
Added hie.yaml
mmhat Jun 20, 2024
ad55906
Moved sources of validity-test to own directory
mmhat Jun 18, 2024
6e9ca25
Better use of IS_WINDOWS
mmhat Jun 18, 2024
7030cb8
Renamed the Foo type class to CheckInstantiated
mmhat Jun 20, 2024
1467bd3
Testsuite test: Moved TH stuff to own modules
mmhat Jun 20, 2024
e1b88b7
Testsuite test: Preliminary work to move more tests into the Common m…
mmhat Jun 20, 2024
79f0740
Testsuite test: Moved 'dirname' tests to Common modules
mmhat Jun 20, 2024
25f480e
Testsuite test: Moved 'filename' tests to Common modules
mmhat Jun 20, 2024
fa8c390
Testsuite test: Moved 'parent' tests to Common modules
mmhat Jun 20, 2024
fe559b9
Testsuite test: Moved 'splitDrive' tests to Common modules
mmhat Jun 20, 2024
16de840
Testsuite test: Moved 'isProperPrefixOf' tests to Common modules
mmhat Jun 20, 2024
d5b1bd1
Testsuite test: Moved 'stripProperPrefix' tests to Common modules
mmhat Jun 20, 2024
0fdb2e6
Testsuite test: Moved '</>' tests to Common modules
mmhat Jun 20, 2024
532ae73
Testsuite test: Moved some utilities to Common modules
mmhat Jun 20, 2024
9ef2340
Replicated source code to OsPath namespace
mmhat Jun 18, 2024
4db62ad
Adjusted version constraints and added os-string dependency
mmhat Jun 18, 2024
b5b8833
Use platform filepaths in OsPath.Internal modules
mmhat Jun 18, 2024
7a25335
Use platform filepaths in the OsPath modules of the public API
mmhat Jun 20, 2024
c04a187
Replicated test testsuite to test-ospath testsuite
mmhat Jun 20, 2024
588b90c
Use OsPath modules in test-ospath
mmhat Jun 20, 2024
b2a0cac
Moved normalization functions to Internal modules
mmhat Jun 20, 2024
1a527de
Moved validation functions to Internal modules
mmhat Jun 20, 2024
202529e
Replicated validity-test testsuite to validity-test-ospath testsuite
mmhat Jun 20, 2024
296930f
validity-test-ospath: Different modules for different platforms
mmhat Jun 20, 2024
f48c66e
Added orphan instance for OsPath paths to validity-test-ospath
mmhat Jun 20, 2024
5200bbd
Use OsPath modules in validity-test-ospath
mmhat Jun 20, 2024
8f2ba1c
Updated Stack configuration
mmhat Jun 21, 2024
d22abd4
Updated Stack configuration again
mmhat Jun 21, 2024
06dc7e4
Applied suggestions
mmhat Jun 24, 2024
3cf6556
Better documentation for FromJSON/ToJSON instances
mmhat Jun 25, 2024
55fe3bd
Better GenValid instance for PosixPath/WindowsPath
mmhat Jun 25, 2024
3f4c450
Moved aeson instances of OsPath to OsPath.Aeson namespace
mmhat Jun 25, 2024
e73559b
Provide newtype wrappers to control the decoding/encoding in OsPath a…
mmhat Jun 25, 2024
32c140e
Added Path.Internal.{Posix,Windows}.isWindows and removed some CPP fr…
mmhat Jun 25, 2024
5a16815
Added explicit conversion functions to OsPath.Aeson modules
mmhat Jun 26, 2024
db0807f
Removed Aeson instances for OsPath
mmhat Jul 14, 2024
9de73ab
Empty `Validity PLATFORM_PATH` instance
mmhat Jul 19, 2024
f8ded6a
Some small, final changes
Jul 29, 2024
179f6ef
Updated CI, tested-with and removed some dependencies
Jul 29, 2024
e2c1ec9
Support for filepath >=1.4.100.0 && <1.5
mmhat Jul 29, 2024
b2d8b95
Fixed Cabal conditionals, stack setup and HIE configuration
mmhat Jul 29, 2024
fe1eae9
Better compat sublibrary
mmhat Jul 30, 2024
3706145
Conditional filepath dependency for main library
mmhat Jul 30, 2024
56fb8cb
Added Stack configuration for +old-os-string
mmhat Jul 30, 2024
0fb94c9
Better backwards compatibility
mmhat Aug 9, 2024
1c000ee
Updated CI: Test Stack build with os-string flag
mmhat Aug 9, 2024
c105f76
Updated CI: Better cache keys
mmhat Aug 9, 2024
383ce37
Updated CI: Better naming of stack jobs
mmhat Aug 9, 2024
9b2bbe1
Updated CI: Use actions/cache@v4
mmhat Aug 9, 2024
7e1bf06
Removed extra-deps from stack.yaml
mmhat Aug 9, 2024
36a6cdf
Applied suggestions
mmhat Aug 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .ghci

This file was deleted.

16 changes: 16 additions & 0 deletions hie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cradle:
cabal:
- path: "src"
component: "lib:path"

- path: "test"
component: "path:test:test"

- path: "test-ospath"
component: "path:test:test-ospath"

- path: "validity-test"
component: "path:test:validity-test"

- path: "validity-test-ospath"
component: "path:test:validity-test-ospath"
78 changes: 71 additions & 7 deletions path.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ extra-source-files: README.md
, CHANGELOG
, src/Path/Include.hs
, src/Path/Internal/Include.hs
, src/OsPath/Include.hs
, src/OsPath/Internal/Include.hs
, test/Common/Include.hs
, test-ospath/Common/Include.hs
, validity-test-ospath/Include.hs
, validity-test-ospath/OsPath/Gen/Include.hs

flag dev
description: Turn on development settings.
Expand All @@ -30,12 +35,19 @@ library
, Path.Internal
, Path.Internal.Posix
, Path.Internal.Windows
, OsPath
, OsPath.Posix
, OsPath.Windows
, OsPath.Internal
, OsPath.Internal.Posix
, OsPath.Internal.Windows
build-depends: aeson
, base >= 4.12 && < 5
, deepseq
, exceptions >= 0.4 && < 0.11
, filepath < 1.2.0.1 || >= 1.3
, filepath >= 1.5.0.0
, hashable >= 1.2 && < 1.5
, os-string >= 2.0.0
, text
, template-haskell
if flag(dev)
Expand All @@ -56,13 +68,41 @@ test-suite test
, Windows
, Common.Posix
, Common.Windows
, TH.Posix
, TH.Windows
hs-source-dirs: test
build-depends: aeson
, base >= 4.12 && < 5
, base
, bytestring
, filepath
, hspec >= 2.0 && < 3
, mtl >= 2.0 && < 3
, path
, template-haskell
if flag(dev)
ghc-options: -Wall -Werror
else
ghc-options: -O2 -Wall
default-language: Haskell2010

test-suite test-ospath
type: exitcode-stdio-1.0
main-is: Main.hs
other-modules: Posix
, Windows
, Common.Posix
, Common.Windows
, TH.Posix
, TH.Windows
hs-source-dirs: test-ospath
build-depends: aeson
, base
, bytestring
, filepath < 1.2.0.1 || >= 1.3
, exceptions
, filepath
, hspec >= 2.0 && < 3
, mtl >= 2.0 && < 3
, os-string
, path
, template-haskell
if flag(dev)
Expand All @@ -73,19 +113,43 @@ test-suite test

test-suite validity-test
type: exitcode-stdio-1.0
main-is: ValidityTest.hs
main-is: Main.hs
other-modules: Path.Gen
hs-source-dirs: test
hs-source-dirs: validity-test
build-depends: QuickCheck
, aeson
, base
, bytestring
, filepath
, genvalidity >= 1.0
, genvalidity-property >= 0.4
, genvalidity-hspec >= 0.7
, hspec >= 2.0 && < 3
, mtl >= 2.0 && < 3
, path
, validity >= 0.8.0.0
default-language: Haskell2010
ghc-options: -threaded -rtsopts -with-rtsopts=-N

test-suite validity-test-ospath
type: exitcode-stdio-1.0
main-is: Main.hs
other-modules: OsPath.Gen.Posix
, OsPath.Gen.Windows
, Posix
, Windows
hs-source-dirs: validity-test-ospath
build-depends: QuickCheck
, aeson
, base >= 4.12 && < 5
, base
, bytestring
, filepath < 1.2.0.1 || >= 1.3
, filepath
, genvalidity >= 1.0
, genvalidity-property >= 0.4
, genvalidity-hspec >= 0.7
, hspec >= 2.0 && < 3
, mtl >= 2.0 && < 3
, os-string
, path
, validity >= 0.8.0.0
default-language: Haskell2010
Expand Down
15 changes: 15 additions & 0 deletions src/OsPath.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- | This library provides a well-typed representation of paths in a filesystem
-- directory tree.
--
-- Both "Path.Posix" and "Path.Windows" provide the same interface. This
-- module will reexport the appropriate module for your platform.

{-# LANGUAGE CPP #-}

#if defined(mingw32_HOST_OS)
module OsPath(module OsPath.Windows) where
import OsPath.Windows
#else
module OsPath(module OsPath.Posix) where
import OsPath.Posix
#endif
Loading
Loading