tptp-0.1.2.0: Parser and pretty printer for the TPTP language

Copyright(c) Evgenii Kotelnikov 2019
LicenseGPL-3
Maintainerevgeny.kotelnikov@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.TPTP.Pretty

Contents

Description

 
Synopsis

Documentation

class Pretty a where #

Overloaded conversion to Doc.

Laws:

  1. output should be pretty. :-)

Minimal complete definition

pretty

Methods

pretty :: a -> Doc ann #

>>> pretty 1 <+> pretty "hello" <+> pretty 1.234
1 hello 1.234

prettyList :: [a] -> Doc ann #

prettyList is only used to define the instance Pretty a => Pretty [a]. In normal circumstances only the pretty function is used.

>>> prettyList [1, 23, 456]
[1, 23, 456]
Instances
Pretty Bool
>>> pretty True
True
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Bool -> Doc ann #

prettyList :: [Bool] -> Doc ann #

Pretty Char

Instead of (pretty '\n'), consider using line as a more readable alternative.

>>> pretty 'f' <> pretty 'o' <> pretty 'o'
foo
>>> pretty ("string" :: String)
string
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Char -> Doc ann #

prettyList :: [Char] -> Doc ann #

Pretty Double
>>> pretty (exp 1 :: Double)
2.71828182845904...
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Double -> Doc ann #

prettyList :: [Double] -> Doc ann #

Pretty Float
>>> pretty (pi :: Float)
3.1415927
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Float -> Doc ann #

prettyList :: [Float] -> Doc ann #

Pretty Int
>>> pretty (123 :: Int)
123
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Int -> Doc ann #

prettyList :: [Int] -> Doc ann #

Pretty Int8 
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Int8 -> Doc ann #

prettyList :: [Int8] -> Doc ann #

Pretty Int16 
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Int16 -> Doc ann #

prettyList :: [Int16] -> Doc ann #

Pretty Int32 
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Int32 -> Doc ann #

prettyList :: [Int32] -> Doc ann #

Pretty Int64 
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Int64 -> Doc ann #

prettyList :: [Int64] -> Doc ann #

Pretty Integer
>>> pretty (2^123 :: Integer)
10633823966279326983230456482242756608
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Integer -> Doc ann #

prettyList :: [Integer] -> Doc ann #

Pretty Natural 
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Natural -> Doc ann #

prettyList :: [Natural] -> Doc ann #

Pretty Word 
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Word -> Doc ann #

prettyList :: [Word] -> Doc ann #

Pretty Word8 
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Word8 -> Doc ann #

prettyList :: [Word8] -> Doc ann #

Pretty Word16 
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Word16 -> Doc ann #

prettyList :: [Word16] -> Doc ann #

Pretty Word32 
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Word32 -> Doc ann #

prettyList :: [Word32] -> Doc ann #

Pretty Word64 
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Word64 -> Doc ann #

prettyList :: [Word64] -> Doc ann #

Pretty ()
>>> pretty ()
()

The argument is not used,

>>> pretty (error "Strict?" :: ())
()
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: () -> Doc ann #

prettyList :: [()] -> Doc ann #

Pretty Text

(lazy Doc instance, identical to the strict version)

Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Text -> Doc ann #

prettyList :: [Text] -> Doc ann #

Pretty Text

Automatically converts all newlines to line.

>>> pretty ("hello\nworld" :: Text)
hello
world

Note that line can be undone by group:

>>> group (pretty ("hello\nworld" :: Text))
hello world

Manually use hardline if you definitely want newlines.

Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Text -> Doc ann #

prettyList :: [Text] -> Doc ann #

Pretty Void

Finding a good example for printing something that does not exist is hard, so here is an example of printing a list full of nothing.

>>> pretty ([] :: [Void])
[]
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Void -> Doc ann #

prettyList :: [Void] -> Doc ann #

Pretty Info Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Info -> Doc ann #

prettyList :: [Info] -> Doc ann #

Pretty Expression Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Expression -> Doc ann #

prettyList :: [Expression] -> Doc ann #

Pretty Parent Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Parent -> Doc ann #

prettyList :: [Parent] -> Doc ann #

Pretty Dataform Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Dataform -> Doc ann #

prettyList :: [Dataform] -> Doc ann #

Pretty NoSuccess Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: NoSuccess -> Doc ann #

prettyList :: [NoSuccess] -> Doc ann #

Pretty Success Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Success -> Doc ann #

prettyList :: [Success] -> Doc ann #

Pretty Status Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Status -> Doc ann #

prettyList :: [Status] -> Doc ann #

Pretty Source Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Source -> Doc ann #

prettyList :: [Source] -> Doc ann #

Pretty Intro Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Intro -> Doc ann #

prettyList :: [Intro] -> Doc ann #

Pretty TSTP Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: TSTP -> Doc ann #

prettyList :: [TSTP] -> Doc ann #

Pretty TPTP Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: TPTP -> Doc ann #

prettyList :: [TPTP] -> Doc ann #

Pretty Unit Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Unit -> Doc ann #

prettyList :: [Unit] -> Doc ann #

Pretty UnitName Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: UnitName -> Doc ann #

prettyList :: [UnitName] -> Doc ann #

Pretty Declaration Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Declaration -> Doc ann #

prettyList :: [Declaration] -> Doc ann #

Pretty Formula Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Formula -> Doc ann #

prettyList :: [Formula] -> Doc ann #

Pretty QuantifiedSort Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: QuantifiedSort -> Doc ann #

prettyList :: [QuantifiedSort] -> Doc ann #

Pretty Unsorted Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Unsorted -> Doc ann #

prettyList :: [Unsorted] -> Doc ann #

Pretty Connective Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Connective -> Doc ann #

prettyList :: [Connective] -> Doc ann #

Pretty Quantifier Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Quantifier -> Doc ann #

prettyList :: [Quantifier] -> Doc ann #

Pretty Clause Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Clause -> Doc ann #

prettyList :: [Clause] -> Doc ann #

Pretty Literal Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Literal -> Doc ann #

prettyList :: [Literal] -> Doc ann #

Pretty Sign Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Sign -> Doc ann #

prettyList :: [Sign] -> Doc ann #

Pretty Term Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Term -> Doc ann #

prettyList :: [Term] -> Doc ann #

Pretty Number Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Number -> Doc ann #

prettyList :: [Number] -> Doc ann #

Pretty Type Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Type -> Doc ann #

prettyList :: [Type] -> Doc ann #

Pretty TFF1Sort Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: TFF1Sort -> Doc ann #

prettyList :: [TFF1Sort] -> Doc ann #

Pretty DistinctObject Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: DistinctObject -> Doc ann #

prettyList :: [DistinctObject] -> Doc ann #

Pretty Var Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Var -> Doc ann #

prettyList :: [Var] -> Doc ann #

Pretty Atom Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Atom -> Doc ann #

prettyList :: [Atom] -> Doc ann #

Pretty Language Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Language -> Doc ann #

prettyList :: [Language] -> Doc ann #

Pretty a => Pretty [a]
>>> pretty [1,2,3]
[1, 2, 3]
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: [a] -> Doc ann #

prettyList :: [[a]] -> Doc ann #

Pretty a => Pretty (Maybe a)

Ignore Nothings, print Just contents.

>>> pretty (Just True)
True
>>> braces (pretty (Nothing :: Maybe Bool))
{}
>>> pretty [Just 1, Nothing, Just 3, Nothing]
[1, 3]
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Maybe a -> Doc ann #

prettyList :: [Maybe a] -> Doc ann #

Pretty a => Pretty (Identity a)
>>> pretty (Identity 1)
1
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Identity a -> Doc ann #

prettyList :: [Identity a] -> Doc ann #

Pretty a => Pretty (NonEmpty a) 
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: NonEmpty a -> Doc ann #

prettyList :: [NonEmpty a] -> Doc ann #

Pretty s => Pretty (Sorted s) Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Sorted s -> Doc ann #

prettyList :: [Sorted s] -> Doc ann #

Pretty s => Pretty (FirstOrder s) Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: FirstOrder s -> Doc ann #

prettyList :: [FirstOrder s] -> Doc ann #

Named s => Pretty (Name s) Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Name s -> Doc ann #

prettyList :: [Name s] -> Doc ann #

Named s => Pretty (Reserved s) Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Reserved s -> Doc ann #

prettyList :: [Reserved s] -> Doc ann #

Pretty (Either QuantifiedSort TFF1Sort) Source # 
Instance details

Defined in Data.TPTP.Pretty

Pretty (Either Var Atom) Source # 
Instance details

Defined in Data.TPTP.Pretty

Methods

pretty :: Either Var Atom -> Doc ann #

prettyList :: [Either Var Atom] -> Doc ann #

(Pretty a1, Pretty a2) => Pretty (a1, a2)
>>> pretty (123, "hello")
(123, hello)
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: (a1, a2) -> Doc ann #

prettyList :: [(a1, a2)] -> Doc ann #

(Pretty a1, Pretty a2, Pretty a3) => Pretty (a1, a2, a3)
>>> pretty (123, "hello", False)
(123, hello, False)
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: (a1, a2, a3) -> Doc ann #

prettyList :: [(a1, a2, a3)] -> Doc ann #

Pretty a => Pretty (Const a b) 
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Const a b -> Doc ann #

prettyList :: [Const a b] -> Doc ann #

Orphan instances

Pretty Info Source # 
Instance details

Methods

pretty :: Info -> Doc ann #

prettyList :: [Info] -> Doc ann #

Pretty Expression Source # 
Instance details

Methods

pretty :: Expression -> Doc ann #

prettyList :: [Expression] -> Doc ann #

Pretty Parent Source # 
Instance details

Methods

pretty :: Parent -> Doc ann #

prettyList :: [Parent] -> Doc ann #

Pretty Dataform Source # 
Instance details

Methods

pretty :: Dataform -> Doc ann #

prettyList :: [Dataform] -> Doc ann #

Pretty NoSuccess Source # 
Instance details

Methods

pretty :: NoSuccess -> Doc ann #

prettyList :: [NoSuccess] -> Doc ann #

Pretty Success Source # 
Instance details

Methods

pretty :: Success -> Doc ann #

prettyList :: [Success] -> Doc ann #

Pretty Status Source # 
Instance details

Methods

pretty :: Status -> Doc ann #

prettyList :: [Status] -> Doc ann #

Pretty Source Source # 
Instance details

Methods

pretty :: Source -> Doc ann #

prettyList :: [Source] -> Doc ann #

Pretty Intro Source # 
Instance details

Methods

pretty :: Intro -> Doc ann #

prettyList :: [Intro] -> Doc ann #

Pretty TSTP Source # 
Instance details

Methods

pretty :: TSTP -> Doc ann #

prettyList :: [TSTP] -> Doc ann #

Pretty TPTP Source # 
Instance details

Methods

pretty :: TPTP -> Doc ann #

prettyList :: [TPTP] -> Doc ann #

Pretty Unit Source # 
Instance details

Methods

pretty :: Unit -> Doc ann #

prettyList :: [Unit] -> Doc ann #

Pretty UnitName Source # 
Instance details

Methods

pretty :: UnitName -> Doc ann #

prettyList :: [UnitName] -> Doc ann #

Pretty Declaration Source # 
Instance details

Methods

pretty :: Declaration -> Doc ann #

prettyList :: [Declaration] -> Doc ann #

Pretty Formula Source # 
Instance details

Methods

pretty :: Formula -> Doc ann #

prettyList :: [Formula] -> Doc ann #

Pretty QuantifiedSort Source # 
Instance details

Methods

pretty :: QuantifiedSort -> Doc ann #

prettyList :: [QuantifiedSort] -> Doc ann #

Pretty Unsorted Source # 
Instance details

Methods

pretty :: Unsorted -> Doc ann #

prettyList :: [Unsorted] -> Doc ann #

Pretty Connective Source # 
Instance details

Methods

pretty :: Connective -> Doc ann #

prettyList :: [Connective] -> Doc ann #

Pretty Quantifier Source # 
Instance details

Methods

pretty :: Quantifier -> Doc ann #

prettyList :: [Quantifier] -> Doc ann #

Pretty Clause Source # 
Instance details

Methods

pretty :: Clause -> Doc ann #

prettyList :: [Clause] -> Doc ann #

Pretty Literal Source # 
Instance details

Methods

pretty :: Literal -> Doc ann #

prettyList :: [Literal] -> Doc ann #

Pretty Sign Source # 
Instance details

Methods

pretty :: Sign -> Doc ann #

prettyList :: [Sign] -> Doc ann #

Pretty Term Source # 
Instance details

Methods

pretty :: Term -> Doc ann #

prettyList :: [Term] -> Doc ann #

Pretty Number Source # 
Instance details

Methods

pretty :: Number -> Doc ann #

prettyList :: [Number] -> Doc ann #

Pretty Type Source # 
Instance details

Methods

pretty :: Type -> Doc ann #

prettyList :: [Type] -> Doc ann #

Pretty TFF1Sort Source # 
Instance details

Methods

pretty :: TFF1Sort -> Doc ann #

prettyList :: [TFF1Sort] -> Doc ann #

Pretty DistinctObject Source # 
Instance details

Methods

pretty :: DistinctObject -> Doc ann #

prettyList :: [DistinctObject] -> Doc ann #

Pretty Var Source # 
Instance details

Methods

pretty :: Var -> Doc ann #

prettyList :: [Var] -> Doc ann #

Pretty Atom Source # 
Instance details

Methods

pretty :: Atom -> Doc ann #

prettyList :: [Atom] -> Doc ann #

Pretty Language Source # 
Instance details

Methods

pretty :: Language -> Doc ann #

prettyList :: [Language] -> Doc ann #

Pretty s => Pretty (Sorted s) Source # 
Instance details

Methods

pretty :: Sorted s -> Doc ann #

prettyList :: [Sorted s] -> Doc ann #

Pretty s => Pretty (FirstOrder s) Source # 
Instance details

Methods

pretty :: FirstOrder s -> Doc ann #

prettyList :: [FirstOrder s] -> Doc ann #

Named s => Pretty (Name s) Source # 
Instance details

Methods

pretty :: Name s -> Doc ann #

prettyList :: [Name s] -> Doc ann #

Named s => Pretty (Reserved s) Source # 
Instance details

Methods

pretty :: Reserved s -> Doc ann #

prettyList :: [Reserved s] -> Doc ann #

Named s => Named (Reserved s) Source # 
Instance details

Methods

name :: Reserved s -> Text Source #

Pretty (Either QuantifiedSort TFF1Sort) Source # 
Instance details

Pretty (Either Var Atom) Source # 
Instance details

Methods

pretty :: Either Var Atom -> Doc ann #

prettyList :: [Either Var Atom] -> Doc ann #