shake-plus: Re-export of Shake using well-typed paths and ReaderT.

[ development, library, mit, shake ] [ Propose Tags ] [ Report a vulnerability ]
Versions [RSS] 0.0.1.0, 0.0.1.1, 0.0.1.2, 0.0.2.0, 0.0.2.1, 0.0.2.2, 0.0.3.0, 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.1.0, 0.1.2.0, 0.1.3.0, 0.1.4.0, 0.1.4.1, 0.1.5.0, 0.1.6.0, 0.1.7.0, 0.1.8.0, 0.1.9.0, 0.1.10.0, 0.2.0.0, 0.2.0.1, 0.3.0.0, 0.3.1.0, 0.3.2.0, 0.3.3.0, 0.3.3.1, 0.3.4.0
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), comonad, extra, path, rio, shake [details]
License MIT
Copyright 2020 Daniel Firth
Author Daniel Firth
Maintainer dan.firth@homotopic.tech
Category development, shake
Home page https://gitlab.com/shake-plus/shake-plus
Uploaded by locallycompact at 2020-07-18T19:02:18Z
Distributions LTSHaskell:0.3.4.0, NixOS:0.3.4.0
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 8504 total (46 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-07-18 [all 1 reports]

Readme for shake-plus-0.3.0.0

[back to package description]

Shake+ - Super Powered Shake

Attempt at a batteries included Shake. We reexport replacements for the main utility functions of Shake with the following adjustments whereever possible.

  • Well-typed paths using the path library.
  • New type classes MonadAction, MonadUnliftAction and MonadRules with concrete ReaderT transformers:
    • RAction r a = RAction (ReaderT r Action a) and
    • ShakePlus r a = ShakePlus (ReaderT r Rules a)
  • Text instead of String wherever it is appropriate.

Paths

Using the path library is kind of a no brainer. I lose a lot of time to problems that could be avoided by using this library, so it's everywhere. The names for these functions shadow the existing names, so you may want to import qualified Development.Shake while this library progresses if you have other FilePath based Shake rules that you want to mix into your build.

The standard Development.Shake.FilePath functions for directory manipulation are not re-exported in full, and you should use the functions in the path library (such as replaceExtension) and other path-based libraries. This will probably change.

FilePatterns are kept as-is, as Path is strongly normalizing it makes sense to keep these as Strings.

RAction

The ReaderT r Action a transformer (called RAction) is similar to the RIO type and should be used similarly. In fact, you can reuse the logging functions from RIO within any RAction block, which is one of the main motivators for having an Action which is also a MonadReader. If you need to reuse an existing shake Action in an RAction, use liftAction.

runShakePlus

The main entry point to this library is the runShakePlus function, which collapses a ReaderT r Rules () to a Rules () and passes the environment to each underlying RAction. The rs in ShakePlus and the underlying RActions have to match. A typical setup might look like this.

let r = --setup env here
shake shakeOptions $ do

    -- include some regular shake rules.

    runShakePlus r $ do

      -- some shake-plus rules.