tptp 0.1.0.2 → 0.1.0.3
raw patch · 10 files changed
+78/−14 lines, 10 files
Files
- CHANGELOG.md +4/−0
- src/Data/TPTP.hs +6/−0
- src/Data/TPTP/Parse/Combinators.hs +13/−3
- src/Data/TPTP/Parse/Text.hs +6/−0
- src/Data/TPTP/Parse/Text/Lazy.hs +6/−0
- src/Data/TPTP/Pretty.hs +16/−9
- test/QuickCheckSpec/Generators.hs +6/−0
- test/QuickCheckSpec/Main.hs +7/−0
- test/UnitTests.hs +5/−0
- tptp.cabal +9/−2
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for tptp +## 0.1.0.3 -- 2019-06-11++* Support compilation with GHC 7.8.+ ## 0.1.0.0 -- 2019-05-07 * First version. Released on an unsuspecting world.
src/Data/TPTP.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE LambdaCase #-}+{-# LANGUAGE CPP #-} -- | -- Module : Data.TPTP@@ -96,6 +97,11 @@ import Data.String (IsString, fromString) import qualified Data.Text as Text (all, null, head, tail) import Data.Text (Text)++#if !MIN_VERSION_base(4, 8, 0)+import Data.Foldable (Foldable)+import Data.Traversable (Traversable, traverse)+#endif -- $setup -- >>> :set -XOverloadedStrings
src/Data/TPTP/Parse/Combinators.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-}+{-# LANGUAGE CPP #-} -- | -- Module : Data.TPTP.Parse.Combinators@@ -47,12 +48,14 @@ info ) where -import Control.Applicative ((<|>), optional)+#if MIN_VERSION_base(4, 8, 0)+import Prelude hiding (pure, (<$>), (<*>), (*>), (<*))+#endif -import Data.Attoparsec.Text as Atto hiding (Number, number)+import Control.Applicative (pure, (<*>), (*>), (<*), (<|>), optional) import Data.Char (isAscii, isAsciiLower, isAsciiUpper, isDigit, isPrint) import Data.Function (on)-import Data.Functor (($>))+import Data.Functor ((<$>), ($>)) import Data.List (sortBy, genericLength) import Data.List.NonEmpty (NonEmpty) import qualified Data.List.NonEmpty as NEL (fromList, toList)@@ -61,6 +64,13 @@ import Data.Text (Text) import qualified Data.Text as Text (pack, unpack, cons)++import Data.Attoparsec.Text as Atto (+ Parser,+ (<?>), char, string, decimal, scientific, signed, isEndOfLine, endOfLine,+ satisfy, option, eitherP, choice, manyTill, takeWhile, skipSpace, skipMany,+ skipWhile, endOfInput, sepBy, sepBy1+ ) import Data.TPTP hiding (name, clause) import qualified Data.TPTP as TPTP (name)
src/Data/TPTP/Parse/Text.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE CPP #-}+ -- | -- Module : Data.TPTP.Parse.Text -- Description : An attoparsec-based parser for the TPTP language.@@ -18,6 +20,10 @@ parseTPTPOnly, parseTPTPWith ) where++#if !MIN_VERSION_base(4, 8, 0)+import Control.Applicative ((*>), (<*))+#endif import Data.Attoparsec.Text (Result, parse, parseOnly, parseWith, endOfInput) import Data.Text (Text)
src/Data/TPTP/Parse/Text/Lazy.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE CPP #-}+ -- | -- Module : Data.TPTP.Parse.Text.Lazy -- Description : An attoparsec-based parser for the TPTP language.@@ -14,6 +16,10 @@ -- * Runners of parsers for TPTP inputs parseTPTP ) where++#if !MIN_VERSION_base(4, 8, 0)+import Control.Applicative ((*>), (<*))+#endif import Data.Attoparsec.Text.Lazy (Result, parse, endOfInput) import Data.Text.Lazy (Text)
src/Data/TPTP/Pretty.hs view
@@ -17,23 +17,30 @@ Pretty(..) ) where +#if !MIN_VERSION_base(4, 8, 0)+import Data.Functor ((<$>))+import Data.Monoid (mempty)+#endif++#if !MIN_VERSION_base(4, 11, 0)+import Data.Semigroup ((<>))+#endif+ import Data.Char (isAsciiLower, isAsciiUpper, isDigit) import Data.List (genericReplicate) import Data.List.NonEmpty (NonEmpty) import qualified Data.List.NonEmpty as NEL (nonEmpty, toList) import Data.Maybe (maybeToList) import Data.Text (Text)-import qualified Data.Text as Text (all, head, tail, cons, snoc,- pack, singleton, replace)--#if __GLASGOW_HASKELL__ >= 803-import Prelude hiding ((<>))-#endif+import qualified Data.Text as Text (+ all, head, tail, cons, snoc, pack, singleton, replace+ )+import Data.Text.Prettyprint.Doc (+ Doc, Pretty(..),+ hsep, sep, (<+>), brackets, parens, punctuate, comma, space+ ) import Data.TPTP--import Data.Text.Prettyprint.Doc (Doc, Pretty(..), hsep, sep, (<>), (<+>),- brackets, parens, punctuate, comma, space) -- * Helper functions
test/QuickCheckSpec/Generators.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE LambdaCase #-}+{-# LANGUAGE CPP #-} -- | -- Module : Generators@@ -13,6 +14,11 @@ -- module Generators () where++#if !MIN_VERSION_base(4, 8, 0)+import Data.Functor ((<$>))+import Control.Applicative (pure, (<*>))+#endif import GHC.Generics (Generic) import Generic.Random (genericArbitraryU, genericArbitraryRec, (%))
test/QuickCheckSpec/Main.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE CPP #-} -- | -- Module : Main@@ -13,6 +14,12 @@ -- module Main where++#if MIN_VERSION_base(4, 8, 0)+import Prelude hiding ((<*))+#endif++import Control.Applicative ((<*)) import Data.Attoparsec.Text (Parser, parseOnly, endOfInput) import Data.Text.Prettyprint.Doc (layoutPretty, defaultLayoutOptions)
test/UnitTests.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-}+{-# LANGUAGE CPP #-} -- | -- Module : UnitTests@@ -16,6 +17,10 @@ Progress(..), Result(..)) import System.Directory (listDirectory)++#if !MIN_VERSION_base(4, 8, 0)+import Data.Functor ((<$>))+#endif import Data.Text (Text) import qualified Data.Text.IO as Text.IO (readFile)
tptp.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: tptp-version: 0.1.0.2+version: 0.1.0.3 synopsis: A parser and a pretty printer for the TPTP language description: <http://www.tptp.org TPTP> (Thousands of Problems for Theorem Provers)@@ -18,11 +18,12 @@ maintainer: evgeny.kotelnikov@gmail.com category: Language, Parsing, Pretty Printer, Theorem Provers, Formal Methods tested-with:+ GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4,- GHC == 8.6.3+ GHC == 8.6.5 extra-source-files: CHANGELOG.md@@ -60,8 +61,14 @@ scientific >= 0.3.6 && < 0.4, prettyprinter >= 1.2.1 && < 1.3, if impl(ghc < 8)+ ghc-options:+ -fwarn-incomplete-record-updates -fwarn-incomplete-uni-patterns build-depends: semigroups >= 0.16.1 && < 0.19+ if impl(ghc >= 8)+ ghc-options:+ -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns+ -Wredundant-constraints test-suite quickcheck-spec type: exitcode-stdio-1.0