dino-0.1.1: A convenient tagless EDSL

Safe HaskellNone
LanguageHaskell2010

Dino.Pretty

Description

Helpers for pretty printing

Synopsis

Documentation

data Importance Source #

Constructors

Unimportant 
Important 
Instances
Eq Importance Source # 
Instance details

Defined in Dino.Pretty

Show Importance Source # 
Instance details

Defined in Dino.Pretty

Generic Importance Source # 
Instance details

Defined in Dino.Pretty

Associated Types

type Rep Importance :: Type -> Type #

Semigroup Importance Source #

Returns Important iff. any argument is Important.

Instance details

Defined in Dino.Pretty

Hashable Importance Source # 
Instance details

Defined in Dino.Pretty

type Rep Importance Source # 
Instance details

Defined in Dino.Pretty

type Rep Importance = D1 (MetaData "Importance" "Dino.Pretty" "dino-0.1.1-7LXbXF9Xj9rEVvJZpadz56" False) (C1 (MetaCons "Unimportant" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Important" PrefixI False) (U1 :: Type -> Type))

unchanged :: Doc Source #

Marks a part of a value that hasn't changed

emphasize :: Importance -> Doc -> Doc Source #

Emphasize when Important

underHeader Source #

Arguments

:: Doc

Header

-> Doc

Document to place under the header

-> Doc 

Place a document indented under a header:

header
  doc
  doc
  ...

verticalList :: Doc -> Doc -> Doc -> [Doc] -> Doc Source #

Render a list of documents as follows:

[ a
, b
, ...
]

where '[', ',' and ']' are provided as the first three parameters.

newtype Field Source #

A wrapper for String with a Show instance that omits quotes

Useful in situations where show is (ab)used to provide conversion to String rather than for displaying values.

Constructors

Field 

Fields

Instances
Eq Field Source # 
Instance details

Defined in Dino.Pretty

Methods

(==) :: Field -> Field -> Bool #

(/=) :: Field -> Field -> Bool #

Ord Field Source # 
Instance details

Defined in Dino.Pretty

Methods

compare :: Field -> Field -> Ordering #

(<) :: Field -> Field -> Bool #

(<=) :: Field -> Field -> Bool #

(>) :: Field -> Field -> Bool #

(>=) :: Field -> Field -> Bool #

max :: Field -> Field -> Field #

min :: Field -> Field -> Field #

Show Field Source # 
Instance details

Defined in Dino.Pretty

Methods

showsPrec :: Int -> Field -> ShowS #

show :: Field -> String #

showList :: [Field] -> ShowS #

IsString Field Source # 
Instance details

Defined in Dino.Pretty

Methods

fromString :: String -> Field #

Pretty Field Source # 
Instance details

Defined in Dino.Pretty

Methods

pretty :: Field -> Doc #

prettyList :: [Field] -> Doc #

Hashable Field Source # 
Instance details

Defined in Dino.Pretty

Methods

hashWithSalt :: Int -> Field -> Int #

hash :: Field -> Int #

Inspectable a => Inspectable (Mapping Field a) Source # 
Instance details

Defined in Dino.AST

prettyRecord :: (Show k, Ord k) => Importance -> HashMap k Doc -> Doc Source #

Render a record as follows:

{ field1 =
    value1
, field2 =
    value2
,  ...
}

If k is a String-like type, it will be shown with quotes. Use Field to prevent this.