refurb-0.3.0.2: Tools for maintaining a database
Safe HaskellNone
LanguageHaskell2010

Refurb.Run.Internal

Description

Module containing shared types and functions used for implementing the various commands.

Synopsis

Documentation

data Context Source #

Reader context for all command execution which contains the command line options, database connection and connection information, and known migrations.

Constructors

Context 

Fields

type MonadRefurb m = (MonadBaseControl IO m, MonadFail m, MonadMask m, MonadReader Context m, MonadLogger m, MonadLoggerIO m) Source #

Constraint of actions for command execution, including access to the Context, logging, and underlying IO.

optionallyColorM :: MonadRefurb m => m (Doc -> Doc) Source #

Given the configuration implicitly available to MonadRefurb, produce a function which possibly strips ANSI colorization from a Doc if the user requested colorless output.

optionallyColoredM :: MonadRefurb m => m (Doc -> m ()) Source #

Given the configuration implicitly available to MonadRefurb, produce a function which emits a Doc on stdout that is colored unless the user requested colorless output.

migrationResultDoc :: MigrationResult -> Doc Source #

Produce a colorized Doc with success or failure, based on which MigrationResult value was passed.