uu-interleaved 0.2.0.0 → 0.2.0.1
raw patch · 2 files changed
+23/−9 lines, 2 filesdep ~basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base
API changes (from Hackage documentation)
- Control.Applicative.Interleaved: instance Functor f => Alternative (Gram f)
- Control.Applicative.Interleaved: instance Functor f => Applicative (Gram f)
- Control.Applicative.Interleaved: instance Functor f => Functor (Alt f)
- Control.Applicative.Interleaved: instance Functor f => Functor (Gram f)
- Control.Applicative.Interleaved: instance Functor f => Monad (Gram f)
- Control.Applicative.Interleaved: instance Functor f => Monoid (Gram f (r -> r))
- Control.Applicative.Interleaved: instance Show a => Show (Gram f a)
+ Control.Applicative.Interleaved: (<>) :: Semigroup a => a -> a -> a
+ Control.Applicative.Interleaved: All :: Bool -> All
+ Control.Applicative.Interleaved: Any :: Bool -> Any
+ Control.Applicative.Interleaved: Dual :: a -> Dual a
+ Control.Applicative.Interleaved: Endo :: a -> a -> Endo a
+ Control.Applicative.Interleaved: First :: Maybe a -> First a
+ Control.Applicative.Interleaved: Last :: Maybe a -> Last a
+ Control.Applicative.Interleaved: Product :: a -> Product a
+ Control.Applicative.Interleaved: Sum :: a -> Sum a
+ Control.Applicative.Interleaved: [appEndo] :: Endo a -> a -> a
+ Control.Applicative.Interleaved: [getAll] :: All -> Bool
+ Control.Applicative.Interleaved: [getAny] :: Any -> Bool
+ Control.Applicative.Interleaved: [getDual] :: Dual a -> a
+ Control.Applicative.Interleaved: [getFirst] :: First a -> Maybe a
+ Control.Applicative.Interleaved: [getLast] :: Last a -> Maybe a
+ Control.Applicative.Interleaved: [getProduct] :: Product a -> a
+ Control.Applicative.Interleaved: [getSum] :: Sum a -> a
+ Control.Applicative.Interleaved: class Semigroup a => Monoid a
+ Control.Applicative.Interleaved: getAlt :: Alt f a -> f a
+ Control.Applicative.Interleaved: infixl 4 <||>
+ Control.Applicative.Interleaved: infixr 6 <>
+ Control.Applicative.Interleaved: instance GHC.Base.Functor f => GHC.Base.Alternative (Control.Applicative.Interleaved.Gram f)
+ Control.Applicative.Interleaved: instance GHC.Base.Functor f => GHC.Base.Applicative (Control.Applicative.Interleaved.Gram f)
+ Control.Applicative.Interleaved: instance GHC.Base.Functor f => GHC.Base.Functor (Control.Applicative.Interleaved.Alt f)
+ Control.Applicative.Interleaved: instance GHC.Base.Functor f => GHC.Base.Functor (Control.Applicative.Interleaved.Gram f)
+ Control.Applicative.Interleaved: instance GHC.Base.Functor f => GHC.Base.Monad (Control.Applicative.Interleaved.Gram f)
+ Control.Applicative.Interleaved: instance GHC.Base.Functor f => GHC.Base.Monoid (Control.Applicative.Interleaved.Gram f (r -> r))
+ Control.Applicative.Interleaved: instance GHC.Base.Functor f => GHC.Base.Semigroup (Control.Applicative.Interleaved.Gram f (r -> r))
+ Control.Applicative.Interleaved: instance GHC.Show.Show a => GHC.Show.Show (Control.Applicative.Interleaved.Gram f a)
+ Control.Applicative.Interleaved: mappend :: Monoid a => a -> a -> a
+ Control.Applicative.Interleaved: mconcat :: Monoid a => [a] -> a
+ Control.Applicative.Interleaved: mempty :: Monoid a => a
+ Control.Applicative.Interleaved: newtype All
+ Control.Applicative.Interleaved: newtype Any
+ Control.Applicative.Interleaved: newtype Dual a
+ Control.Applicative.Interleaved: newtype Endo a
+ Control.Applicative.Interleaved: newtype First a
+ Control.Applicative.Interleaved: newtype Last a
+ Control.Applicative.Interleaved: newtype Product a
+ Control.Applicative.Interleaved: newtype Sum a
- Control.Applicative.Interleaved: (<||>) :: Functor f => Gram f (a1 -> a) -> Gram f a1 -> Gram f a
+ Control.Applicative.Interleaved: (<||>) :: Functor f => Gram f a1 -> a2 -> Gram f a1 -> Gram f a2
Files
src/Control/Applicative/Interleaved.hs view
@@ -27,6 +27,7 @@ -- import Text.ParserCombinators.UU.Core import Control.Applicative+import Data.Semigroup as Sem #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 710 import Data.Monoid hiding (Alt) #else@@ -54,10 +55,18 @@ getPure :: f a -> Maybe a -- * Grammars can be used as a monoid using the <||> combinator to combine them and (.) for composing results+-- Split up into Monoid + Semigroup for GHC 8.4, see+-- <https://prime.haskell.org/wiki/Libraries/Proposals/SemigroupMonoid#Writingcompatiblecode>+instance Functor f => Sem.Semigroup (Gram f (r -> r)) where+ p <> q = (.) <$> p <||> q instance Functor f => Monoid (Gram f (r -> r)) where- mappend p q = (.) <$> p <||> q mempty = empty+#if !(MIN_VERSION_base(4,11,0))+ -- this is redundant starting with base-4.11 / GHC 8.4+ -- if you want to avoid CPP, you can define `mappend = (<>)` unconditionally+ mappend = (<>)+#endif instance (Show a) => Show (Gram f a) where show (Gram l ma) = "Gram " ++ show (length l) ++ " " ++ show ma
uu-interleaved.cabal view
@@ -1,5 +1,5 @@ Name: uu-interleaved-Version: 0.2.0.0+Version: 0.2.0.1 Build-Type: Simple License: MIT Copyright: S Doaitse Swierstra @@ -7,16 +7,21 @@ Author: Doaitse Swierstra, Utrecht University Maintainer: Doaitse Swierstra Stability: stable, but evolving-Homepage: http://www.cs.uu.nl/wiki/bin/view/HUT/ParserCombinators+Homepage: https://github.com/UU-ComputerScience/uu-interleaved Bug-reports: mailto:doaitse@swierstra.net -Synopsis: Providing an interleaving combinator for use with applicative/alternative style implementations.-Description: This module contains parser library independent code which can be used to describe inlerleaved execution of applicative style structures. - It is amongst other used in the uu-options package, which provides facilities for parsing command-line options or files containing preferences. - It generalises the permuting parsers and the list merging parsers as e.g. found in the uulib library. For a more complete description see the Technical Report - describing its implementation and use see http://www.cs.uu.nl/research/techreps/UU-CS-2013-005.html-Category: Control, Applicative, Parsing, Text+Synopsis: Providing an interleaving combinator for use with applicative style implementations.+Description: This module contains parser library independent code which can be used to describe+ interleaved execution of applicative style structures. + It is amongst other used in the uu-options package, which provides facilities for+ parsing command-line options or files containing preferences. + It generalises the permuting parsers and the list merging parsers as e.g. found in+ the uulib library. For a more complete description see the Technical Report + describing its implementation and use see+ http://www.cs.uu.nl/research/techreps/UU-CS-2013-005.html cabal-version: >= 1.6++Category: Control, Applicative, Parsing, Text source-repository head type: svn