Given a record like Example {a = "a", b = "b", c = "c"}
how can I pretty print any record type like this to make it easier to read (more human friendly)?
Somthing like:
Example {
a = "a"
, b = "b"
, c = "c"
}
would be ideal.
I've tried pPrint from the pretty-show
package but this doesn't seem to output any different to show
.
This can be achieved with: pretty-simple
:
ghci> import Text.Pretty.Simple (pPrint)
ghci> data Example = Example { a, b, c :: String } deriving Show
ghci> pPrint Example {a = "a", b = "b", c = "c"}
Example
{ a = "a"
, b = "b"
, c = "c"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With