hw-parser 0.0.0.3 → 0.0.0.4
raw patch · 4 files changed
+76/−40 lines, 4 filesdep +hedgehogdep +hspecdep +hw-hspec-hedgehogdep −mono-traversabledep ~attoparsecdep ~bytestringdep ~hw-primPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: hedgehog, hspec, hw-hspec-hedgehog, hw-parser
Dependencies removed: mono-traversable
Dependency ranges changed: attoparsec, bytestring, hw-prim, text
API changes (from Hackage documentation)
- HaskellWorks.Data.Parser: instance HaskellWorks.Data.Parser.Parser Data.ByteString.Internal.ByteString
- HaskellWorks.Data.Parser: instance HaskellWorks.Data.Parser.Parser Data.Text.Internal.Text
+ HaskellWorks.Data.Parser: instance HaskellWorks.Data.Parser.Parser Data.ByteString.Internal.ByteString GHC.Word.Word8
+ HaskellWorks.Data.Parser: instance HaskellWorks.Data.Parser.Parser Data.Text.Internal.Text GHC.Types.Char
- HaskellWorks.Data.Parser: (<?>) :: Parser t => Parser t Char -> String -> Parser t Char
+ HaskellWorks.Data.Parser: (<?>) :: Parser t e => Parser t Char -> String -> Parser t Char
- HaskellWorks.Data.Parser: char :: Parser t => Char -> Parser t Char
+ HaskellWorks.Data.Parser: char :: Parser t e => Char -> Parser t Char
- HaskellWorks.Data.Parser: class MonoTraversable t => Parser t
+ HaskellWorks.Data.Parser: class Parser t e | t -> e
- HaskellWorks.Data.Parser: rational :: (Parser t, Fractional f) => Parser t f
+ HaskellWorks.Data.Parser: rational :: (Parser t e, Fractional f) => Parser t f
- HaskellWorks.Data.Parser: satisfy :: Parser t => (Element t -> Bool) -> Parser t (Element t)
+ HaskellWorks.Data.Parser: satisfy :: Parser t e => (e -> Bool) -> Parser t e
- HaskellWorks.Data.Parser: satisfyChar :: Parser t => (Char -> Bool) -> Parser t Char
+ HaskellWorks.Data.Parser: satisfyChar :: Parser t e => (Char -> Bool) -> Parser t Char
- HaskellWorks.Data.Parser: satisfyWith :: Parser t => (Element t -> a) -> (a -> Bool) -> Parser t a
+ HaskellWorks.Data.Parser: satisfyWith :: Parser t e => (e -> a) -> (a -> Bool) -> Parser t a
- HaskellWorks.Data.Parser: string :: Parser t => t -> Parser t t
+ HaskellWorks.Data.Parser: string :: Parser t e => t -> Parser t t
- HaskellWorks.Data.Parser: try :: Parser t => Parser t a -> Parser t a
+ HaskellWorks.Data.Parser: try :: Parser t e => Parser t a -> Parser t a
Files
- README.md +1/−1
- hw-parser.cabal +57/−26
- src/HaskellWorks/Data/Parser.hs +17/−13
- test/Spec.hs +1/−0
README.md view
@@ -1,2 +1,2 @@ # hw-parser-[](https://circleci.com/gh/haskell-works/hw-parser/tree/0.0-branch)+[](https://circleci.com/gh/haskell-works/hw-parser/tree/master)
hw-parser.cabal view
@@ -1,31 +1,62 @@-name: hw-parser-version: 0.0.0.3-synopsis: Simple parser support-description: Please see README.md-homepage: http://github.com/haskell-works/hw-parser#readme-license: BSD3-license-file: LICENSE-author: John Ky-maintainer: newhoggy@gmail.com-copyright: 2016 John Ky-category: Data, Parser-build-type: Simple-extra-source-files: README.md-cabal-version: >= 1.22+cabal-version: 2.2 -library- hs-source-dirs: src- exposed-modules: HaskellWorks.Data.Parser- build-depends: base >= 4 && < 5- , attoparsec- , bytestring- , hw-prim >= 0.4.0.0- , mono-traversable- , text+name: hw-parser+version: 0.0.0.4+synopsis: Simple parser support+description: Simple parser support. Please see README.md+category: Data, Parser+homepage: http://github.com/haskell-works/hw-parser#readme+bug-reports: https://github.com/haskell-works/hw-parser/issues+author: John Ky+maintainer: newhoggy@gmail.com+copyright: 2016-2019 John Ky+license: BSD-3-Clause+license-file: LICENSE+tested-with: GHC == 8.8.1, GHC == 8.6.5, GHC == 8.4.4, GHC == 8.2.2+build-type: Simple - default-language: Haskell2010- ghc-options: -Wall -msse4.2+extra-source-files:+ README.md source-repository head- type: git+ type: git location: https://github.com/haskell-works/hw-parser++common base { build-depends: base >= 4 && < 5 }++common attoparsec { build-depends: attoparsec >= 0.13 && < 0.14 }+common bytestring { build-depends: bytestring >= 0.10.6 && < 0.11 }+common hedgehog { build-depends: hedgehog >= 1.0 && < 1.1 }+common hspec { build-depends: hspec >= 2.4 && < 3 }+common hw-hspec-hedgehog { build-depends: hw-hspec-hedgehog >= 0.1.0.4 && < 0.2 }+common hw-prim { build-depends: hw-prim >= 0.6.2.21 && < 0.7 }+common text { build-depends: text >= 1.2 && < 1.3 }++common config+ default-language: Haskell2010+ ghc-options: -Wall++library+ import: base, config+ , attoparsec+ , bytestring+ , hw-prim+ , text+ hs-source-dirs: src+ exposed-modules: HaskellWorks.Data.Parser+ other-modules: Paths_hw_parser+ autogen-modules: Paths_hw_parser++test-suite hw-parser-test+ import: base, config+ , hedgehog+ , hspec+ , hw-hspec-hedgehog+ type: exitcode-stdio-1.0+ main-is: Spec.hs+ build-depends: hw-parser+ hs-source-dirs: test+ ghc-options: -threaded -rtsopts -with-rtsopts=-N+ build-tool-depends: hspec-discover:hspec-discover+ other-modules: Paths_hw_parser+ autogen-modules: Paths_hw_parser
src/HaskellWorks/Data/Parser.hs view
@@ -1,19 +1,23 @@+{-# LANGUAGE FunctionalDependencies #-}+{-# LANGUAGE MultiParamTypeClasses #-}+ module HaskellWorks.Data.Parser ( Parser(..) ) where -import qualified Data.Attoparsec.ByteString as ABS-import qualified Data.Attoparsec.ByteString.Char8 as BC-import qualified Data.Attoparsec.Text as AT-import qualified Data.Attoparsec.Types as T-import Data.ByteString (ByteString)-import Data.MonoTraversable-import Data.Text (Text)-import HaskellWorks.Data.Char.IsChar+import Data.ByteString (ByteString)+import Data.Text (Text)+import Data.Word+import HaskellWorks.Data.Char.IsChar -class MonoTraversable t => Parser t where- satisfy :: (Element t -> Bool) -> T.Parser t (Element t)- satisfyWith :: (Element t -> a) -> (a -> Bool) -> T.Parser t a+import qualified Data.Attoparsec.ByteString as ABS+import qualified Data.Attoparsec.ByteString.Char8 as BC+import qualified Data.Attoparsec.Text as AT+import qualified Data.Attoparsec.Types as T++class Parser t e | t -> e where+ satisfy :: (e -> Bool) -> T.Parser t e+ satisfyWith :: (e -> a) -> (a -> Bool) -> T.Parser t a satisfyChar :: (Char -> Bool) -> T.Parser t Char string :: t -> T.Parser t t try :: T.Parser t a -> T.Parser t a@@ -21,7 +25,7 @@ (<?>) :: T.Parser t Char -> String -> T.Parser t Char rational :: Fractional f => T.Parser t f -instance Parser ByteString where+instance Parser ByteString Word8 where satisfy = ABS.satisfy satisfyWith = ABS.satisfyWith satisfyChar = ABS.satisfyWith toChar@@ -39,7 +43,7 @@ {-# INLINE (<?>) #-} {-# INLINE rational #-} -instance Parser Text where+instance Parser Text Char where satisfy = AT.satisfy satisfyWith = AT.satisfyWith satisfyChar = AT.satisfyWith toChar
+ test/Spec.hs view
@@ -0,0 +1,1 @@+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}