Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data RenderContext = RenderContext {
- orientation :: Orientation
- tty :: TTY
- indent :: Natural
- context :: Maybe Natural
- newtype Render a = Render {
- unRender :: ReaderT RenderContext (Writer Text) a
- runRender :: Render a -> RenderContext -> (a, Text)
- runRender' :: Render () -> RenderContext -> Text
- echo :: Text -> Render ()
- indented :: Natural -> Render a -> Render a
- data TTY
- escape :: Text -> Text -> Text
- red :: TTY -> Text -> Text
- redBackground :: Orientation -> TTY -> Text -> Text
- green :: TTY -> Text -> Text
- greenBackground :: Orientation -> TTY -> Text -> Text
- grey :: Orientation -> TTY -> Text -> Text
- minus :: TTY -> Text -> Text
- plus :: TTY -> Text -> Text
- explain :: Text -> Text
- renderWith :: Changed a -> ((Text -> Text, a) -> Render ()) -> Render ()
- renderOutputs :: OutputNames -> Text
- renderDiffHumanReadable :: DerivationDiff -> Render ()
- zippers :: [a] -> [([a], a, [a])]
Documentation
data RenderContext Source #
RenderContext | |
|
Instances
MonadReader RenderContext Render Source # | |
Defined in Nix.Diff.Render.HumanReadable ask :: Render RenderContext # local :: (RenderContext -> RenderContext) -> Render a -> Render a # reader :: (RenderContext -> a) -> Render a # |
Instances
Applicative Render Source # | |
Functor Render Source # | |
Monad Render Source # | |
MonadReader RenderContext Render Source # | |
Defined in Nix.Diff.Render.HumanReadable ask :: Render RenderContext # local :: (RenderContext -> RenderContext) -> Render a -> Render a # reader :: (RenderContext -> a) -> Render a # | |
MonadWriter Text Render Source # | |
runRender' :: Render () -> RenderContext -> Text Source #
This exists to improve compatibility with less -R
. See:
redBackground :: Orientation -> TTY -> Text -> Text Source #
Color text background red
greenBackground :: Orientation -> TTY -> Text -> Text Source #
Color text background green
renderWith :: Changed a -> ((Text -> Text, a) -> Render ()) -> Render () Source #
Utility to automate a common pattern of printing the two halves of a diff. This passes the correct formatting function to each half
renderOutputs :: OutputNames -> Text Source #
Format the derivation outputs
renderDiffHumanReadable :: DerivationDiff -> Render () Source #