Hoogle Search

Within LTS Haskell 24.39 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. pPrintForceColorLightBg :: (MonadIO m, Show a) => a -> m ()

    pretty-simple Text.Pretty.Simple

    Just like pPrintForceColorDarkBg, but for printing to a light background.

  2. pPrintLightBg :: (MonadIO m, Show a) => a -> m ()

    pretty-simple Text.Pretty.Simple

    Just like pPrintDarkBg, but for printing to a light background.

  3. pPrintNoColor :: (MonadIO m, Show a) => a -> m ()

    pretty-simple Text.Pretty.Simple

    Similar to pPrint, but doesn't print in color. However, data types will still be indented nicely.

    >>> pPrintNoColor $ Just ["hello", "bye"]
    Just
    [ "hello"
    , "bye"
    ]
    

  4. pPrintOpt :: (MonadIO m, Show a) => CheckColorTty -> OutputOptions -> a -> m ()

    pretty-simple Text.Pretty.Simple

    Similar to pPrint but takes OutputOptions to change how the pretty-printing is done. For example, pPrintOpt can be used to make the indentation much smaller than normal. This is what the normal indentation looks like:

    >>> pPrintOpt NoCheckColorTty defaultOutputOptionsNoColor $ Just ("hello", "bye")
    Just
    ( "hello"
    , "bye"
    )
    
    This is what smaller indentation looks like:
    >>> let smallIndent = defaultOutputOptionsNoColor {outputOptionsIndentAmount = 1}
    
    >>> pPrintOpt CheckColorTty smallIndent $ Just ("hello", "bye")
    Just
    ( "hello"
    , "bye"
    )
    
    Lines in strings get indented
    >>> pPrintOpt NoCheckColorTty defaultOutputOptionsNoColor (1, (2, "foo\nbar\nbaz", 3))
    ( 1
    ,
    ( 2
    , "foo
    bar
    baz"
    , 3
    )
    )
    
    Lines get indented even in custom show instances
    >>> data Foo = Foo
    
    >>> instance Show Foo where show _ = "foo\nbar\nbaz"
    
    >>> pPrintOpt CheckColorTty defaultOutputOptionsNoColor (1, (2, Foo, 3))
    ( 1
    ,
    ( 2
    , foo
    bar
    baz
    , 3
    )
    )
    
    CheckColorTty determines whether to test stdout for whether or not it is connected to a TTY. If set to NoCheckColorTty, then pPrintOpt won't check if stdout is a TTY. It will print in color depending on the value of outputOptionsColorOptions. If set to CheckColorTty, then pPrintOpt will check if stdout is conneted to a TTY. If stdout is determined to be connected to a TTY, then it will print in color depending on the value of outputOptionsColorOptions. If stdout is determined to NOT be connected to a TTY, then it will NOT print in color, regardless of the value of outputOptionsColorOptions.

  5. pPrintString :: MonadIO m => String -> m ()

    pretty-simple Text.Pretty.Simple

    Similar to pPrint, but the first argument is a String representing a data type that has already been showed.

    >>> pPrintString $ show [ Just (1, "hello"), Nothing ]
    [ Just
    ( 1
    , "hello"
    )
    , Nothing
    ]
    

  6. pPrintStringDarkBg :: MonadIO m => String -> m ()

    pretty-simple Text.Pretty.Simple

    Alias for pPrintString.

  7. pPrintStringForceColor :: MonadIO m => String -> m ()

    pretty-simple Text.Pretty.Simple

    Similar to pPrintString, but print in color regardless of whether the output goes to a TTY or not. See pPrintString for an example of how to use this function.

  8. pPrintStringForceColorDarkBg :: MonadIO m => String -> m ()

    pretty-simple Text.Pretty.Simple

    Alias for pPrintStringForceColor.

  9. pPrintStringForceColorLightBg :: MonadIO m => String -> m ()

    pretty-simple Text.Pretty.Simple

    Just like pPrintStringForceColorDarkBg, but for printing to a light background.

  10. pPrintStringLightBg :: MonadIO m => String -> m ()

    pretty-simple Text.Pretty.Simple

    Just like pPrintStringDarkBg, but for printing to a light background.

Page 298 of many | Previous | Next