Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Utilities for showing string-like things.
Documentation
showj :: (ToJSON a, IsString b) => a -> b Source #
Show the JSON representation as any kind of string-like thing. Primarily useful for dumping JSON values into log messages without having to jump through too many hoops.
Wrapper whose Show
instance outputs JSON.
Especially useful with `-XDerivingVia` e.g.
newtype Foo = Foo SomeType deriving Show via (ShowJ SomeType)
This will cause @show (foo :: Foo) to output the JSON representation of SomeType.
ShowJ a |