frisby 0.2.2 → 0.2.3
raw patch · 2 files changed
+13/−7 lines, 2 filesdep +failPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: fail
API changes (from Hackage documentation)
- Text.Parsers.Frisby: instance Data.Semigroup.Semigroup (Text.Parsers.Frisby.P s a)
- Text.Parsers.Frisby: instance Data.Semigroup.Semigroup (Text.Parsers.Frisby.PE a)
+ Text.Parsers.Frisby: (*>) :: Applicative f => f a -> f b -> f b
+ Text.Parsers.Frisby: (<$) :: Functor f => a -> f b -> f a
+ Text.Parsers.Frisby: (<$>) :: Functor f => (a -> b) -> f a -> f b
+ Text.Parsers.Frisby: (<*) :: Applicative f => f a -> f b -> f a
+ Text.Parsers.Frisby: (<**>) :: Applicative f => f a -> f (a -> b) -> f b
+ Text.Parsers.Frisby: (<*>) :: Applicative f => f (a -> b) -> f a -> f b
+ Text.Parsers.Frisby: (<|>) :: Alternative f => f a -> f a -> f a
+ Text.Parsers.Frisby: Const :: a -> Const a
+ Text.Parsers.Frisby: WrapArrow :: a b c -> WrappedArrow b c
+ Text.Parsers.Frisby: WrapMonad :: m a -> WrappedMonad a
+ Text.Parsers.Frisby: ZipList :: [a] -> ZipList a
+ Text.Parsers.Frisby: [getConst] :: Const a -> a
+ Text.Parsers.Frisby: [getZipList] :: ZipList a -> [a]
+ Text.Parsers.Frisby: [unwrapArrow] :: WrappedArrow b c -> a b c
+ Text.Parsers.Frisby: [unwrapMonad] :: WrappedMonad a -> m a
+ Text.Parsers.Frisby: class Applicative f => Alternative (f :: Type -> Type)
+ Text.Parsers.Frisby: class Functor f => Applicative (f :: Type -> Type)
+ Text.Parsers.Frisby: empty :: Alternative f => f a
+ Text.Parsers.Frisby: instance GHC.Base.Semigroup (Text.Parsers.Frisby.P s a)
+ Text.Parsers.Frisby: instance GHC.Base.Semigroup (Text.Parsers.Frisby.PE a)
+ Text.Parsers.Frisby: liftA :: Applicative f => (a -> b) -> f a -> f b
+ Text.Parsers.Frisby: liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
+ Text.Parsers.Frisby: liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
+ Text.Parsers.Frisby: newtype Const a (b :: k) :: forall k. () => Type -> k -> Type
+ Text.Parsers.Frisby: newtype WrappedArrow (a :: Type -> Type -> Type) b c
+ Text.Parsers.Frisby: newtype WrappedMonad (m :: Type -> Type) a
+ Text.Parsers.Frisby: newtype ZipList a
+ Text.Parsers.Frisby: pure :: Applicative f => a -> f a
+ Text.Parsers.Frisby: some :: Alternative f => f a -> f [a]
- Text.Parsers.Frisby: newRegex :: Monad m => String -> m (PM s (P s String))
+ Text.Parsers.Frisby: newRegex :: MonadFail m => String -> m (PM s (P s String))
Files
- Text/Parsers/Frisby.hs +9/−3
- frisby.cabal +4/−4
Text/Parsers/Frisby.hs view
@@ -179,6 +179,7 @@ import qualified Control.Applicative (many) import qualified Data.IntSet as IntSet import Control.Monad.Fix+import Control.Monad.Fail import Control.Monad.Identity import Data.Char(ord,chr) import Control.Monad.State@@ -187,6 +188,7 @@ import qualified Data.Semigroup as Semigroup import Data.Monoid hiding(Any,(<>)) import qualified Data.Map as Map+import qualified Control.Monad.Fail as Fail import Prelude hiding((<>)) --inline usable part of Unsafe.Coerce until that module is commonly available@@ -807,11 +809,11 @@ -- | Create a new regular expression matching parser. it returns something in a -- possibly failing monad to indicate an error in the regular expression itself. -newRegex :: Monad m => String -> m (PM s (P s String))+newRegex :: Fail.MonadFail m => String -> m (PM s (P s String)) newRegex s = case parse_regex s of Just r -> return (return $ regexToParser r) Nothing -> err- where err = fail $ "invalid regular expression: " ++ show s+ where err = Fail.fail $ "invalid regular expression: " ++ show s -- | Show a representation of the parsed regex, mainly for debugging.@@ -822,4 +824,8 @@ -- | Make a new regex but abort on an error in the regex string itself. regex :: String -> PM s (P s String)-regex s = runIdentity (newRegex s)+regex s =+ case parse_regex s of+ Just r -> return $ regexToParser r+ Nothing -> err+ where err = error $ "invalid regular expression: " ++ show s
frisby.cabal view
@@ -1,5 +1,5 @@ name: frisby-version: 0.2.2+version: 0.2.3 cabal-version: >=1.6 license: BSD3 copyright: John Meacham (2006)@@ -7,7 +7,6 @@ maintainer: Ben Gamari <ben@smart-cactus.org> stability: experimental homepage: http://repetae.net/computer/frisby/-homepage: http://repetae.net/computer/frisby/ package-url: http://repetae.net/repos/frisby synopsis: Linear time composable parser for PEG grammars description: frisby is a parser library that can parse arbitrary PEG@@ -24,13 +23,14 @@ routines to translate standard regex syntax into frisby parsers. extra-source-files: Changelog.md category: Text-tested-with: GHC == 7.6.*, GHC == 7.8.*, GHC == 7.10.*, GHC == 8.0.*, GHC == 8.2.*+tested-with: GHC == 7.6.*, GHC == 7.8.*, GHC == 7.10.*, GHC == 8.0.*, GHC == 8.2.*,+ GHC == 8.4.*, GHC == 8.6.*, GHC == 8.8.* license-file: LICENSE build-type: Simple library exposed-modules: Text.Parsers.Frisby, Text.Parsers.Frisby.Char- build-depends: base>=4 && <5, containers, mtl, array, semigroups+ build-depends: base>=4 && <5, fail, containers, mtl, array, semigroups source-repository head type: git