path-like

PathLike, FileLike and DirLike type classes for the Path library.

LTS Haskell 22.43:0.2.0.2
Stackage Nightly 2024-12-05:0.2.0.2
Latest on Hackage:0.2.0.2

See all snapshots path-like appears in

MIT licensed by Daniel Firth
Maintained by [email protected]
This version can be pinned in stack with:path-like-0.2.0.2@sha256:14410b4465f09885c35d34ca16312867733b810cf3f9fa0a372feb57ebaf2fba,1055

Module documentation for 0.2.0.2

Depends on 2 packages(full list with versions):
Used by 1 package in lts-22.41(full list with versions):

path-like - Type classes for the Path library.

This library exports type classes PathLike, FileLike and DirLike which serve as a common interface for compiling types down to Path b File and Path b Dir. The only contract that should be respected is that your type should be at least as strict as the Path type itself, i.e no String/FilePath instances. This is the case with the within type.

This library also exports a concatenation function (/>) which defers to the underlying (</>) function in Path, but works for any DirLike and PathLike Rel. This may change to shadow the existing definition if these classes turn out to be generally useful. They tend to be particularly useful for generalising file IO, but you may find you need to cast more when you first construct a Path using TemplateHaskell.

For more information see the path library documentation.

Changes

Changelog for path-like

(v0.2.0.0)

  • Revert ConstraintKinds mess.

(v0.1.1.0)

  • Add ’PathLikesuperclass toFileLikeandDirLike`.

(v0.1.0.0)

  • Add FileLike and DirLike type class for using stricter types as Path b File and Path b Dir respectively.
  • Add (/>) combinator for producing a Path from a DirLike and a FileLike Rel.