hpath: Support for well-typed paths

[ bsd3, filesystem ] [ Propose Tags ]

Support for well-typed paths, utilizing ByteString under the hood.


[Skip to Readme]
Versions [faq] 0.5.9, 0.6.0, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.9.2, 0.10.0, 0.10.1, 0.10.2, 0.11.0 (info)
Change log CHANGELOG
Dependencies base (>=4.8 && <5), bytestring (>=0.10.0.0), deepseq, exceptions, hpath-filepath (==0.10.*), template-haskell, unbuildable (>1 && <1), utf8-string, word8 [details]
License BSD-3-Clause
Copyright Julian Ospald 2016
Author Julian Ospald <hasufell@posteo.de>
Maintainer Julian Ospald <hasufell@posteo.de>
Category Filesystem
Source repo head: git clone https://github.com/hasufell/hpath
Uploaded by maerwald at Mon Jan 20 19:24:09 UTC 2020
Distributions NixOS:0.11.0
Downloads 4519 total (262 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2020-01-20 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for hpath-0.11.0

[back to package description]

HPath

Gitter chat Hackage version Build Status Hackage-Deps

Support for well-typed paths in Haskell.

This package is part of the HPath suite, also check out hpath-filepath and hpath-io.

Motivation

The motivation came during development of hsfm which has a pretty strict File type, but lacks a strict Path type, e.g. for user input.

The library that came closest to my needs was path, but the API turned out to be oddly complicated for my use case, so I decided to fork it.

Goals

  • well-typed paths
  • safe filepath manipulation, never using String as filepath, but ByteString

Note: this library was written for posix systems and it will probably not support other systems.

Differences to 'path'

  • doesn't attempt to fake IO-related information into the path, so whether a path points to a file or directory is up to your IO-code to decide...
  • uses safe ByteString for filepaths under the hood instead of unsafe String
  • fixes broken dirname
  • renames dirname/filename to basename/dirname to match the POSIX shell functions
  • allows pattern matching via unidirectional PatternSynonym
  • uses simple doctest for testing
  • allows ~/ as relative path, because on posix level ~ is just a regular filename that does NOT point to $HOME