hpath/hpath-io/hpath-io.cabal

51 lines
1.6 KiB
Plaintext
Raw Normal View History

name: hpath-io
2020-01-26 20:51:39 +00:00
version: 0.13.0
synopsis: High-level IO operations on files/directories
description: High-level IO operations on files/directories, utilizing type-safe Paths
-- bug-reports:
2016-06-03 22:20:41 +00:00
license: BSD3
2015-05-07 18:14:23 +00:00
license-file: LICENSE
Fork chrisdone's path library I wasn't happy with the way it dealt with Dir vs File things. In his version of the library, a `Path b Dir` always ends with a trailing path separator and `Path b File` never ends with a trailing path separator. IMO, it is nonsensical to make a Dir vs File distinction on path level, although it first seems nice. Some of the reasons are: * a path is just that: a path. It is completely disconnected from IO level and even if a `Dir`/`File` type theoretically allows us to say "this path ought to point to a file", there is literally zero guarantee that it will hold true at runtime. So this basically gives a false feeling of a type-safe file distinction. * it's imprecise about Dir vs File distinction, which makes it even worse, because a directory is also a file (just not a regular file). Add symlinks to that and the confusion is complete. * it makes the API oddly complicated for use cases where we basically don't care (yet) whether something turns out to be a directory or not Still, it comes also with a few perks: * it simplifies some functions, because they now have guarantees whether a path ends in a trailing path separator or not * it may be safer for interaction with other library functions, which behave differently depending on a trailing path separator (like probably shelly) Not limited to, but also in order to fix my remarks without breaking any benefits, I did: * rename the `Dir`/`File` types to `TPS`/`NoTPS`, so it's clear we are only giving information about trailing path separators and not actual file types we don't know about yet * add a `MaybeTPS` type, which does not mess with trailing path separators and also gives no guarantees about them... then added `toNoTPS` and `toTPS` to allow type-safe conversion * make some functions accept more general types, so we don't unnecessarily force paths with trailing separators for `(</>)` for example... instead these functions now examine the paths to still have correct behavior. This is really minor overhead. You might say now "but then I can append filepath to filepath". Well, as I said... we don't know whether it's a "filepath" at all. * merge `filename` and `dirname` into `basename` and make `parent` be `dirname`, so the function names match the name of the POSIX ones, which do (almost) the same... * fix a bug in `basename` (formerly `dirname`) which broke the type guarantees * add a pattern synonym for easier pattern matching without exporting the internal Path constructor
2016-03-08 21:53:42 +00:00
author: Julian Ospald <hasufell@posteo.de>
maintainer: Julian Ospald <hasufell@posteo.de>
2016-05-09 15:37:33 +00:00
copyright: Julian Ospald 2016
2015-05-07 18:14:23 +00:00
category: Filesystem
build-type: Simple
2018-04-10 23:11:40 +00:00
cabal-version: 1.14
2019-12-30 21:37:53 +00:00
tested-with: GHC==7.10.3
, GHC==8.0.2
, GHC==8.2.2
, GHC==8.4.4
, GHC==8.6.5
, GHC==8.8.1
2016-05-09 11:31:20 +00:00
extra-source-files: README.md
CHANGELOG.md
2015-05-07 18:14:23 +00:00
library
2018-04-11 10:31:11 +00:00
if os(windows)
build-depends: unbuildable<0
buildable: False
2020-01-26 20:49:34 +00:00
exposed-modules: HPath.IO
2019-12-30 20:57:38 +00:00
build-depends: base >= 4.8 && <5
2016-06-05 19:52:52 +00:00
, IfElse
, bytestring >= 0.10.0.0
2020-01-18 17:45:17 +00:00
, exceptions
2020-01-20 19:19:45 +00:00
, hpath >= 0.11 && < 0.12
2020-01-26 20:49:34 +00:00
, hpath-directory >= 0.13 && < 0.14
2020-01-18 17:58:21 +00:00
, hpath-filepath >= 0.10.2 && < 0.11
2020-01-13 22:34:15 +00:00
, safe-exceptions >= 0.1
, streamly >= 0.7
2020-01-26 13:27:38 +00:00
, streamly-bytestring >= 0.1
2020-01-18 17:45:17 +00:00
, time >= 1.8
2016-05-09 11:31:20 +00:00
, unix >= 2.5
2016-05-09 14:53:31 +00:00
, unix-bytestring
2016-04-16 16:17:44 +00:00
, utf8-string
2020-01-13 23:07:38 +00:00
if !impl(ghc>=7.11)
build-depends: transformers
hs-source-dirs: src
default-language: Haskell2010
2016-04-16 16:17:44 +00:00
2016-05-09 14:53:31 +00:00
2015-05-14 15:47:04 +00:00
source-repository head
2016-04-16 16:17:44 +00:00
type: git
location: https://github.com/hasufell/hpath