strong-path: Strongly typed paths in Haskell.

[ filepath, filesystem, library, mit, system ] [ Propose Tags ]

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.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 1.0.0.0, 1.0.1.0, 1.0.1.1, 1.1.0.0, 1.1.1.0, 1.1.2.0, 1.1.3.0, 1.1.4.0
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), exceptions (>=0.10.4 && <0.11), filepath (>=1.4.2.1 && <1.5), path (>=0.9.0 && <0.10), template-haskell (>=2.17.0.0 && <2.18) [details]
License MIT
Copyright 2020 Martin Sosic
Author Martin Sosic
Maintainer sosic.martin@gmail.com
Category System, Filesystem, FilePath
Home page https://github.com/wasp-lang/strong-path#readme
Bug tracker https://github.com/wasp-lang/strong-path/issues
Source repo head: git clone https://github.com/wasp-lang/strong-path
Uploaded by Martinsos at 2021-07-11T14:07:20Z
Distributions
Downloads 1352 total (39 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user [build log]
All reported builds failed as of 2021-07-11 [all 1 reports]

Readme for strong-path-1.0.1.0

[back to package description]

StrongPath

CI Documentation Hackage Stackage LTS Stackage Nightly

Strongly typed file paths in Haskell.

This library provides a strongly typed representation of file paths, providing more safety during compile time while also making code more readable, compared to the standard solution (FilePath, which is really just String).

Without StrongPath:

getBashProfile :: IO FilePath

With StrongPath:

getBashProfile :: IO (Path System (Rel HomeDir) (File BashProfile))

Simple but complete example:

import StrongPath (Path, System, Abs, Dir, parseAbsDir)

data HomeDir

getHomeDirPath :: IO (Path System Abs (Dir HomeDir))
getHomeDirPath = getLine >>= fromJust . parseAbsDir

Check documentation for more details!

Documentation

Detailed documentation, including rich examples and API is written via Haddock.

Check out the latest documentation on Hackage: Documentation.

You can also build and view the Haddock documentation yourself if you wish, by running stack haddock --open.

Contributing / development

We are using ormolu for code formatting. In order for the PR to pass, it needs to be formatted by ormolu.

strong-path is Stack project, so make sure you have stack installed on your machine.

stack build to build the project, stack test to run the tests.

stack build --file-watch --haddock to rebuild documentation as you change it.

Publishing to Hackage

stack sdist to build publishable .tar.gz., and then we need to upload it manually to Hackage.

Check if Hackage correctly built the Haddock docs -> if not, you need to upload them manually (check Hackage webpage for instructions).

Make sure to update the version of package in package.yaml.

We should also tag the commit in git with version tag (e.g. v1.0.0.0) so we know which version of code was used to produce that release.