module FP.Pretty.Instances where import FP.Prelude import FP.Pretty.Pretty import FP.Pretty.Deriving instance Pretty Doc where pretty = id instance Pretty ๐น where pretty = ppCon โ ๐ค โ show instance Pretty ๐ where pretty = ppLit โ ๐ค โ show instance Pretty โค where pretty = ppLit โ ๐ค โ show instance Pretty โ where pretty = ppLit โ ๐ค โ show instance Pretty โแต where pretty NInfinity = ppLit "โ" pretty (NFinite n) = pretty n instance Pretty โ where pretty = ppLit โ ๐ค โ show instance Pretty ๐ where pretty = ppLit โ ๐ค โ show instance Pretty ๐ป where pretty = ppLit โ ๐ค โ show instance Pretty () where pretty = ppCon โ ๐ค โ show instance (Pretty a, Pretty b) โ Pretty (a, b) where pretty (a, b) = ppCollection "(" ")" "," [pretty a, pretty b] instance (Pretty a, Pretty b, Pretty c) โ Pretty (a, b, c) where pretty (a, b, c) = ppCollection "(" ")" "," [pretty a, pretty b, pretty c] instance (Pretty a) โ Pretty (Stream a) where pretty xs = ppApp (ppText "stream") [pretty $ list xs] instance (Pretty a) โ Pretty [a] where pretty = ppCollection "[" "]" "," โ map pretty instance (Pretty a) โ Pretty (๐ซ a) where pretty = ppCollection "{" "}" "," โ map pretty โ list instance (Pretty a,Ord a) โ Pretty (๐ซแต a) where pretty = pretty โ concretizeSet instance (Pretty k,Pretty v) โ Pretty (k โฐ v) where pretty = ppRecord "โฆ" โ map (mapPair pretty pretty) โ list instance (Pretty k,Pretty v,Ord k,Monoid v) โ Pretty (k โฐโญโงบ v) where pretty = pretty โ concretizeDictAppend instance (Pretty k,Pretty v,Ord k,JoinLattice v) โ Pretty (k โฐโญโ v) where pretty = pretty โ concretizeDictJoin instance (Pretty a) โ Pretty (AddBot a) where pretty Bot = ppCon "โฅ" pretty (AddBot x) = pretty x instance (Pretty a) โ Pretty (AddTop a) where pretty Top = ppCon "โค" pretty (AddTop x) = pretty x instance (Functorial Pretty f) โ Pretty (Fixed f) where pretty (Fixed f) = with (functorial โท W (Pretty (f (Fixed f)))) $ pretty f makePrettySum ''Maybe makePrettySum ''Either makePrettyUnion ''ID