parsers 0.12.3 → 0.12.4
raw patch · 5 files changed
+112/−28 lines, 5 filesdep ~basedep ~transformerssetup-changedPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, transformers
API changes (from Hackage documentation)
+ Text.Parser.Permutation: infixl 1 <|?>
+ Text.Parser.Permutation: infixl 2 <$?>
- Text.Parser.Char: satisfy :: CharParsing m => (Char -> Bool) -> m Char
+ Text.Parser.Char: satisfy :: (CharParsing m, MonadTrans t, CharParsing n, Monad n, m ~ t n) => (Char -> Bool) -> t n Char
- Text.Parser.Combinators: eof :: Parsing m => m ()
+ Text.Parser.Combinators: eof :: (Parsing m, MonadTrans t, Monad n, Parsing n, m ~ t n) => t n ()
- Text.Parser.Combinators: unexpected :: Parsing m => String -> m a
+ Text.Parser.Combinators: unexpected :: (Parsing m, MonadTrans t, Monad n, Parsing n, m ~ t n) => String -> t n a
- Text.Parser.Expression: buildExpressionParser :: (Parsing m, Applicative m) => OperatorTable m a -> m a -> m a
+ Text.Parser.Expression: buildExpressionParser :: forall m a. (Parsing m, Applicative m) => OperatorTable m a -> m a -> m a
Files
- .travis.yml +90/−13
- Setup.lhs +4/−0
- parsers.cabal +8/−5
- src/Text/Parser/Combinators.hs +7/−7
- tests/doctests.hs +3/−3
.travis.yml view
@@ -1,21 +1,99 @@-language: haskell-before_install:- # Uncomment whenever hackage is down.- # - mkdir -p ~/.cabal && cp travis/config ~/.cabal/config && cabal update+# This file has been generated -- see https://github.com/hvr/multi-ghc-travis+language: c+sudo: false - # Try installing some of the build-deps with apt-get for speed.- - travis/cabal-apt-install --only-dependencies --force-reinstall $mode+cache:+ directories:+ - $HOME/.cabsnap+ - $HOME/.cabal/packages - - sudo apt-get -q -y install hlint || cabal install hlint+before_cache:+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar +matrix:+ include:+ - env: CABALVER=1.18 GHCVER=7.0.4+ compiler: ": #GHC 7.0.4"+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.0.4,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.18 GHCVER=7.2.2+ compiler: ": #GHC 7.2.2"+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.2.2,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.18 GHCVER=7.4.2+ compiler: ": #GHC 7.4.2"+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.4.2,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.18 GHCVER=7.6.3+ compiler: ": #GHC 7.6.3"+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.6.3,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.18 GHCVER=7.8.4+ compiler: ": #GHC 7.8.4"+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.22 GHCVER=7.10.3+ compiler: ": #GHC 7.10.3"+ addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,hlint], sources: [hvr-ghc]}}+ - env: CABALVER=1.24 GHCVER=8.0.1+ compiler: ": #GHC 8.0.1"+ addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1,hlint], sources: [hvr-ghc]}}++before_install:+ - unset CC+ - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH+ install:- - cabal configure -flib-Werror $mode- - cabal build+ - cabal --version+ - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"+ - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];+ then+ zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >+ $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;+ fi+ - travis_retry cabal update -v+ - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config+ - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt+ - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt +# check whether current requested install-plan matches cached package-db snapshot+ - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;+ then+ echo "cabal build-cache HIT";+ rm -rfv .ghc;+ cp -a $HOME/.cabsnap/ghc $HOME/.ghc;+ cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;+ else+ echo "cabal build-cache MISS";+ rm -rf $HOME/.cabsnap;+ mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;+ cabal install --only-dependencies --enable-tests --enable-benchmarks;+ fi++# snapshot package-db on cache miss+ - if [ ! -d $HOME/.cabsnap ];+ then+ echo "snapshotting package-db to build-cache";+ mkdir $HOME/.cabsnap;+ cp -a $HOME/.ghc $HOME/.cabsnap/ghc;+ cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;+ fi++# Here starts the actual work to be performed for the package under test;+# any command which exits with a non-zero exit code causes the build to fail. script:- - $script- - hlint src --cpp-define HLINT+ - if [ -f configure.ac ]; then autoreconf -i; fi+ - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging+ - cabal build # this builds all libraries and executables (including tests/benchmarks)+ - cabal test+ - if [ ! $CABALVER = "1.24" ]; then cabal check; fi+# - cabal sdist # tests that a source-distribution can be generated +# Check that the resulting source distribution can be built & installed.+# If there are no other `.tar.gz` files in `dist`, this can be even simpler:+# `cabal install --force-reinstalls dist/*-*.tar.gz`+# - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&+# (cd dist && cabal install --force-reinstalls "$SRC_TGZ")++# Not included by generator+ - hlint src --cpp-define HLINT+ notifications: irc: channels:@@ -24,5 +102,4 @@ template: - "\x0313parsers\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}" -env:- - mode="--enable-tests" script="cabal test"+# EOF
Setup.lhs view
@@ -30,6 +30,10 @@ withTestLBI pkg lbi $ \suite suitecfg -> do rewriteFile (dir </> "Build_" ++ testName suite ++ ".hs") $ unlines [ "module Build_" ++ testName suite ++ " where"+ , ""+ , "autogen_dir :: String"+ , "autogen_dir = " ++ show dir+ , "" , "deps :: [String]" , "deps = " ++ (show $ formatdeps (testDeps libcfg suitecfg)) ]
parsers.cabal view
@@ -1,6 +1,6 @@ name: parsers category: Text, Parsing-version: 0.12.3+version: 0.12.4 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE@@ -11,13 +11,14 @@ bug-reports: http://github.com/ekmett/parsers/issues copyright: Copyright (C) 2010-2013 Edward A. Kmett synopsis: Parsing combinators-description: +description: This library provides convenient combinators for working with and building parsing combinator libraries. . Given a few simple instances, e.g. for the class 'Text.Parser.Combinators.Parsing' in "Text.Parser.Combinators.Parsing" you get access to a large number of canned definitions. Instances exist for the parsers provided by @parsec@, @attoparsec@ and base’s "Text.Read". build-type: Custom+tested-with: GHC==7.0.4, GHC==7.2.2, GHC==7.4.2, GHC==7.6.3, GHC==7.8.4, GHC==7.10.2, GHC==8.0.1 extra-source-files: .travis.yml @@ -39,17 +40,19 @@ hs-source-dirs: src - ghc-options: -Wall -fno-warn-wrong-do-bind -fwarn-monomorphism-restriction -fwarn-identities -fwarn-incomplete-record-updates -fwarn-incomplete-uni-patterns+ ghc-options: -Wall -fno-warn-wrong-do-bind -fwarn-monomorphism-restriction -fwarn-incomplete-record-updates+ if impl(ghc >= 7.2)+ ghc-options: -fwarn-identities -fwarn-incomplete-uni-patterns build-depends:- base >= 4 && < 5,+ base >= 4.3 && < 5, base-orphans >= 0.3 && < 1, charset >= 0.3 && < 1, containers >= 0.4 && < 0.6, parsec >= 3.1 && < 3.2, attoparsec >= 0.12.1.4 && < 0.14, text >= 0.10 && < 1.3,- transformers >= 0.2 && < 0.5,+ transformers >= 0.2 && < 0.6, scientific >= 0.3 && < 0.4, unordered-containers >= 0.2 && < 0.3
src/Text/Parser/Combinators.hs view
@@ -129,7 +129,7 @@ -- separated and optionally ended by @sep@. Returns a list of values -- returned by @p@. sepEndBy1 :: Alternative m => m a -> m sep -> m [a]-sepEndBy1 p sep = flip id <$> p <*> ((flip (:) <$> (sep *> sepEndBy p sep)) <|> pure pure)+sepEndBy1 p sep = p <**> ((flip (:) <$> (sep *> sepEndBy p sep)) <|> pure pure) -- | @sepEndBy p sep@ parses /zero/ or more occurrences of @p@, -- separated and optionally ended by @sep@, ie. haskell style@@ -162,7 +162,7 @@ | otherwise = sequenceA (replicate n p) {-# INLINE count #-} --- | @chainr p op x@ parser /zero/ or more occurrences of @p@,+-- | @chainr p op x@ parses /zero/ or more occurrences of @p@, -- separated by @op@ Returns a value obtained by a /right/ associative -- application of all functions returned by @op@ to the values returned -- by @p@. If there are no occurrences of @p@, the value @x@ is@@ -171,7 +171,7 @@ chainr p op x = chainr1 p op <|> pure x {-# INLINE chainr #-} --- | @chainl p op x@ parser /zero/ or more occurrences of @p@,+-- | @chainl p op x@ parses /zero/ or more occurrences of @p@, -- separated by @op@. Returns a value obtained by a /left/ associative -- application of all functions returned by @op@ to the values returned -- by @p@. If there are zero occurrences of @p@, the value @x@ is@@ -180,7 +180,7 @@ chainl p op x = chainl1 p op <|> pure x {-# INLINE chainl #-} --- | @chainl1 p op x@ parser /one/ or more occurrences of @p@,+-- | @chainl1 p op x@ parses /one/ or more occurrences of @p@, -- separated by @op@ Returns a value obtained by a /left/ associative -- application of all functions returned by @op@ to the values returned -- by @p@. . This parser can for example be used to eliminate left@@ -197,17 +197,17 @@ -- > <|> (-) <$ symbol "-" chainl1 :: Alternative m => m a -> m (a -> a -> a) -> m a chainl1 p op = scan where- scan = flip id <$> p <*> rst+ scan = p <**> rst rst = (\f y g x -> g (f x y)) <$> op <*> p <*> rst <|> pure id {-# INLINE chainl1 #-} --- | @chainr1 p op x@ parser /one/ or more occurrences of |p|,+-- | @chainr1 p op x@ parses /one/ or more occurrences of @p@, -- separated by @op@ Returns a value obtained by a /right/ associative -- application of all functions returned by @op@ to the values returned -- by @p@. chainr1 :: Alternative m => m a -> m (a -> a -> a) -> m a chainr1 p op = scan where- scan = flip id <$> p <*> rst+ scan = p <**> rst rst = (flip <$> op <*> scan) <|> pure id {-# INLINE chainr1 #-}
tests/doctests.hs view
@@ -1,6 +1,6 @@ module Main where -import Build_doctests (deps)+import Build_doctests (autogen_dir, deps) import Control.Applicative import Control.Monad import Data.List@@ -11,9 +11,9 @@ main :: IO () main = getSources >>= \sources -> doctest $ "-isrc"- : "-idist/build/autogen"+ : ("-i" ++ autogen_dir) : "-optP-include"- : "-optPdist/build/autogen/cabal_macros.h"+ : ("-optP" ++ autogen_dir ++ "/cabal_macros.h") : "-hide-all-packages" : map ("-package="++) deps ++ sources