json-0.11: Support for serialising Haskell to and from JSON
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.JSON.Pretty

Description

Display JSON values using pretty printing combinators.

Documentation

pp_boolean :: Bool -> Doc Source #

pp_number :: Bool -> Rational -> Doc Source #

pp_string :: String -> Doc Source #

pp_object :: [(String, JSValue)] -> Doc Source #

text :: String -> Doc #

($$) :: Doc -> Doc -> Doc #

(<>) :: Doc -> Doc -> Doc #

parens :: Doc -> Doc #

char :: Char -> Doc #

sep :: [Doc] -> Doc #

(<+>) :: Doc -> Doc -> Doc #

first :: Doc -> Doc -> Doc #

data Doc #

Instances

Instances details
IsString Doc 
Instance details

Defined in Text.PrettyPrint.HughesPJ

Methods

fromString :: String -> Doc

Monoid Doc 
Instance details

Defined in Text.PrettyPrint.HughesPJ

Methods

mempty :: Doc

mappend :: Doc -> Doc -> Doc

mconcat :: [Doc] -> Doc

Semigroup Doc 
Instance details

Defined in Text.PrettyPrint.HughesPJ

Methods

(<>) :: Doc -> Doc -> Doc

sconcat :: NonEmpty Doc -> Doc

stimes :: Integral b => b -> Doc -> Doc

Generic Doc 
Instance details

Defined in Text.PrettyPrint.HughesPJ

Associated Types

type Rep Doc 
Instance details

Defined in Text.PrettyPrint.HughesPJ

type Rep Doc = D1 ('MetaData "Doc" "Text.PrettyPrint.HughesPJ" "pretty-1.1.3.6-76dc" 'True) (C1 ('MetaCons "Doc" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ()))))

Methods

from :: Doc -> Rep Doc x

to :: Rep Doc x -> Doc

Show Doc 
Instance details

Defined in Text.PrettyPrint.HughesPJ

Methods

showsPrec :: Int -> Doc -> ShowS

show :: Doc -> String

showList :: [Doc] -> ShowS

NFData Doc 
Instance details

Defined in Text.PrettyPrint.HughesPJ

Methods

rnf :: Doc -> ()

Eq Doc 
Instance details

Defined in Text.PrettyPrint.HughesPJ

Methods

(==) :: Doc -> Doc -> Bool

(/=) :: Doc -> Doc -> Bool

type Rep Doc 
Instance details

Defined in Text.PrettyPrint.HughesPJ

type Rep Doc = D1 ('MetaData "Doc" "Text.PrettyPrint.HughesPJ" "pretty-1.1.3.6-76dc" 'True) (C1 ('MetaCons "Doc" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Doc ()))))

integer :: Integer -> Doc #

float :: Float -> Doc #

double :: Double -> Doc #

fsep :: [Doc] -> Doc #

punctuate :: Doc -> [Doc] -> [Doc] #

hcat :: [Doc] -> Doc #

braces :: Doc -> Doc #

($+$) :: Doc -> Doc -> Doc #

data TextDetails #

Constructors

Chr !Char 
Str String 
PStr String 

Instances

Instances details
Generic TextDetails 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep TextDetails 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

type Rep TextDetails = D1 ('MetaData "TextDetails" "Text.PrettyPrint.Annotated.HughesPJ" "pretty-1.1.3.6-76dc" 'False) (C1 ('MetaCons "Chr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedUnpack) (Rec0 Char)) :+: (C1 ('MetaCons "Str" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "PStr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))

Methods

from :: TextDetails -> Rep TextDetails x

to :: Rep TextDetails x -> TextDetails

Show TextDetails 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

showsPrec :: Int -> TextDetails -> ShowS

show :: TextDetails -> String

showList :: [TextDetails] -> ShowS

NFData TextDetails 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

rnf :: TextDetails -> ()

Eq TextDetails 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

(==) :: TextDetails -> TextDetails -> Bool

(/=) :: TextDetails -> TextDetails -> Bool

type Rep TextDetails 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

type Rep TextDetails = D1 ('MetaData "TextDetails" "Text.PrettyPrint.Annotated.HughesPJ" "pretty-1.1.3.6-76dc" 'False) (C1 ('MetaCons "Chr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedUnpack) (Rec0 Char)) :+: (C1 ('MetaCons "Str" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "PStr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))

data Mode #

Instances

Instances details
Generic Mode 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep Mode 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

type Rep Mode = D1 ('MetaData "Mode" "Text.PrettyPrint.Annotated.HughesPJ" "pretty-1.1.3.6-76dc" 'False) ((C1 ('MetaCons "PageMode" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ZigZagMode" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "LeftMode" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OneLineMode" 'PrefixI 'False) (U1 :: Type -> Type)))

Methods

from :: Mode -> Rep Mode x

to :: Rep Mode x -> Mode

Show Mode 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

showsPrec :: Int -> Mode -> ShowS

show :: Mode -> String

showList :: [Mode] -> ShowS

Eq Mode 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

(==) :: Mode -> Mode -> Bool

(/=) :: Mode -> Mode -> Bool

type Rep Mode 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

type Rep Mode = D1 ('MetaData "Mode" "Text.PrettyPrint.Annotated.HughesPJ" "pretty-1.1.3.6-76dc" 'False) ((C1 ('MetaCons "PageMode" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ZigZagMode" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "LeftMode" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OneLineMode" 'PrefixI 'False) (U1 :: Type -> Type)))

data Style #

Constructors

Style 

Fields

Instances

Instances details
Generic Style 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Associated Types

type Rep Style 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

type Rep Style = D1 ('MetaData "Style" "Text.PrettyPrint.Annotated.HughesPJ" "pretty-1.1.3.6-76dc" 'False) (C1 ('MetaCons "Style" 'PrefixI 'True) (S1 ('MetaSel ('Just "mode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Mode) :*: (S1 ('MetaSel ('Just "lineLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "ribbonsPerLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float))))

Methods

from :: Style -> Rep Style x

to :: Rep Style x -> Style

Show Style 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

showsPrec :: Int -> Style -> ShowS

show :: Style -> String

showList :: [Style] -> ShowS

Eq Style 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

(==) :: Style -> Style -> Bool

(/=) :: Style -> Style -> Bool

type Rep Style 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

type Rep Style = D1 ('MetaData "Style" "Text.PrettyPrint.Annotated.HughesPJ" "pretty-1.1.3.6-76dc" 'False) (C1 ('MetaCons "Style" 'PrefixI 'True) (S1 ('MetaSel ('Just "mode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Mode) :*: (S1 ('MetaSel ('Just "lineLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "ribbonsPerLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float))))

cat :: [Doc] -> Doc #

fcat :: [Doc] -> Doc #

fullRender :: Mode -> Int -> Float -> (TextDetails -> a -> a) -> a -> Doc -> a #

hang :: Doc -> Int -> Doc -> Doc #

hsep :: [Doc] -> Doc #

isEmpty :: Doc -> Bool #

nest :: Int -> Doc -> Doc #

ptext :: String -> Doc #

reduceDoc :: Doc -> RDoc #

sizedText :: Int -> String -> Doc #

vcat :: [Doc] -> Doc #

int :: Int -> Doc #

maybeBraces :: Bool -> Doc -> Doc #

maybeBrackets :: Bool -> Doc -> Doc #

maybeDoubleQuotes :: Bool -> Doc -> Doc #

maybeParens :: Bool -> Doc -> Doc #

maybeQuotes :: Bool -> Doc -> Doc #

quotes :: Doc -> Doc #

rational :: Rational -> Doc #

render :: Doc -> String #

renderStyle :: Style -> Doc -> String #

zeroWidthText :: String -> Doc #