Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Cooked.Pretty.Class
Description
This module provides the PrettyCooked
class and instances for common
Plutus types. We don't rely on Pretty
from Prettyprinter in order to
define better printers for Plutus types which already have instances of
Pretty
. Also, PrettyCooked
makes it possible to optionally modify pretty
printing settings PrettyCookedOpts
(e.g. length of printed hashes).
When defining a new PrettyCooked
instance, prefer implementing
prettyCookedOpt
and relay the option parameter to other printers.
Synopsis
- class PrettyCooked a where
- prettyCooked :: a -> DocCooked
- prettyCookedOpt :: PrettyCookedOpts -> a -> DocCooked
- printCookedOpt :: PrettyCooked a => PrettyCookedOpts -> a -> IO ()
- printCooked :: PrettyCooked a => a -> IO ()
Documentation
class PrettyCooked a where Source #
Minimal complete definition
Nothing
Methods
prettyCooked :: a -> DocCooked Source #
prettyCookedOpt :: PrettyCookedOpts -> a -> DocCooked Source #
Instances
printCookedOpt :: PrettyCooked a => PrettyCookedOpts -> a -> IO () Source #
Use this in the REPL as an alternative to the default print
function when
dealing with pretty-printable cooked values.
For example, printCookedOpt def runMockChain i0 foo
printCooked :: PrettyCooked a => a -> IO () Source #
Version of printCookedOpt
that uses default pretty printing options.