MIT licensed by Li-yao Xia
Maintained by [email protected]

Module documentation for 0.1.0.0

This version can be pinned in stack with:[email protected]:08d7c0c4eb06c8e3fc84ba3d79d748b0f265367f63a0a12855f984ab243aed27,1112

Show combinators

A minimal set of convenient combinators to write Show instances.

data MyType a
  = C a a                   -- a regular constructor
  | a :+: a                 -- an infix constructor
  | R { f1 :: a, f2 :: a }  -- a record

infixl 4 :+:

instance Show a => Show (MyType a) where
  showsPrec = flip precShows where
    precShows (C a b) = showCon "C" @| a @| b
    precShows (c :+: d) = showInfix ":+:" 4 c d
    precShows (R {f1 = e, f2 = f}) =
      showRecord "R" ("f1" .=. e &| "f2" .=. f)
Depends on 1 package(full list with versions):