system-lifted: Lifted versions of System functions.

[ bsd3, library, program, system ] [ Propose Tags ]

Lifted versions of functions provided in System.Directory, System.Environment and others. User can derive instances for EitherT, ErrorT, MaybeT, etc.


[Skip to Readme]

Modules

  • System
    • Directory
      • System.Directory.Lifted
    • Environment
      • System.Environment.Lifted
    • System.Lifted
    • Posix
      • User
        • System.Posix.User.Lifted

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.2.0.1
Dependencies base (>=4.6 && <5.0), directory (>=1.2 && <1.3), either (>=4.1 && <4.4), haskell-src-meta (>=0.6.0.4 && <0.7), template-haskell (>=2.8 && <2.10), text (>=0.11.3 && <1.4), time (>=1.4.0 && <1.5), transformers (>=0.3 && <0.5), unix (>=2.6 && <2.8) [details]
License BSD-3-Clause
Author João Cristóvão
Maintainer jmacristovao@gmail.com
Category System
Home page https://github.com/jcristovao/system-lifted
Uploaded by jcristovao at 2014-05-30T14:58:55Z
Distributions
Reverse Dependencies 2 direct, 0 indirect [details]
Executables main
Downloads 1042 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2015-05-21 [all 7 reports]

Readme for system-lifted-0.2.0.1

[back to package description]

system-lifted

Lifted versions of Haskell System functions.

While haskell promotes the use of Maybe and Either as smart ways of dealing with errors, I found that the support for their Monad Transformers counter-parts is less than stellar.

While some packages like Errors simplify this, they still add a lot of boilerplate to the code.

The goal of this project started out as a way to write cleaner directory related code in either one of the error related monad transformers, namely EitherT, ErrorT or MaybeT (non-determinism and ListT are not yet supported).

This is achieved through typeclasses, and thus, by simply declaring some simple template haskell at the start of a file:

type EitherIOText       = EitherT Text

deriveSystemLiftedErrors "DisallowIOE [HardwareFault]" ''EitherIOText
deriveSystemDirectory   ''EitherIOText

One could then write code like this:

getXdgConfigFolder :: EitherT IOException IO FilePath
getXdgConfigFolder = isRW =<< getEnv "XDG_CONFIG_HOME"

Currently the System.Directory and System.Environment are fully supported, and there is partial support for System.Unix.Users.

More examples and wider System. support is planned. Contribuitions are welcomed.