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

[ development, library, mit, shake ] [ Propose Tags ] [ Report a vulnerability ]

Re-export of Shake using well-typed paths and ReaderT. You can thread logging through your Shake Actions.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
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), extra, path, rio, shake [details]
License MIT
Copyright 2020 Daniel Firth
Author Daniel Firth
Maintainer dan.firth@homotopic.tech
Revised Revision 1 made by locallycompact at 2021-08-04T10:38:56Z
Category development, shake
Source repo head: git clone https://gitlab.homotopic.tech/haskell/shake-plus
Uploaded by locallycompact at 2021-07-10T07:13:23Z
Distributions LTSHaskell:0.3.4.0, NixOS:0.3.4.0
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 8504 total (15 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 2021-07-10 [all 1 reports]

Readme for shake-plus-0.3.4.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.