om-show-0.1.2.6: Utilities for showing string-like things.
Safe HaskellSafe-Inferred
LanguageHaskell2010

OM.Show

Description

Utilities for showing string-like things.

Synopsis

Documentation

showt :: (Show a, IsString b) => a -> b Source #

Like show, but for any string-like thing.

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.

newtype ShowJ a Source #

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.

Constructors

ShowJ a 

Instances

Instances details
ToJSON a => ToJSON (ShowJ a) Source # 
Instance details

Defined in OM.Show

ToJSON a => Show (ShowJ a) Source # 
Instance details

Defined in OM.Show

Methods

showsPrec :: Int -> ShowJ a -> ShowS #

show :: ShowJ a -> String #

showList :: [ShowJ a] -> ShowS #

Eq a => Eq (ShowJ a) Source # 
Instance details

Defined in OM.Show

Methods

(==) :: ShowJ a -> ShowJ a -> Bool #

(/=) :: ShowJ a -> ShowJ a -> Bool #

Ord a => Ord (ShowJ a) Source # 
Instance details

Defined in OM.Show

Methods

compare :: ShowJ a -> ShowJ a -> Ordering #

(<) :: ShowJ a -> ShowJ a -> Bool #

(<=) :: ShowJ a -> ShowJ a -> Bool #

(>) :: ShowJ a -> ShowJ a -> Bool #

(>=) :: ShowJ a -> ShowJ a -> Bool #

max :: ShowJ a -> ShowJ a -> ShowJ a #

min :: ShowJ a -> ShowJ a -> ShowJ a #