diff -ur parsec-3.0.0/Text/Parsec/Pos.hs parsec-3.0.1/Text/Parsec/Pos.hs --- parsec-3.0.0/Text/Parsec/Pos.hs 2008-03-06 06:28:51.000000000 +0000 +++ parsec-3.0.1/Text/Parsec/Pos.hs 2009-09-10 00:04:34.000000000 +0100 @@ -22,6 +22,8 @@ , updatePosChar, updatePosString ) where +import Data.Generics + -- < Source positions: a file name, a line and a column -- upper left is (1,1) @@ -35,7 +37,7 @@ -- 'Ord' class. data SourcePos = SourcePos SourceName !Line !Column - deriving ( Eq, Ord ) + deriving ( Eq, Ord, Data, Typeable) -- | Create a new 'SourcePos' with the given source name, -- line number and column number. diff -ur parsec-3.0.0/Text/Parsec/Prim.hs parsec-3.0.1/Text/Parsec/Prim.hs --- parsec-3.0.0/Text/Parsec/Prim.hs 2008-03-06 06:28:51.000000000 +0000 +++ parsec-3.0.1/Text/Parsec/Prim.hs 2009-09-10 00:04:34.000000000 +0100 @@ -52,7 +52,9 @@ -- | ParserT monad transformer and Parser type -- | @ParsecT s u m a@ is a parser with stream type @s@, user state type @u@, --- underlying monad @m@ and return type @a@ +-- underlying monad @m@ and return type @a@. Parsec is strict in the user state. +-- If this is undesirable, simply used a data type like @data Box a = Box a@ and +-- the state type @Box YourStateType@ to add a level of indirection. data ParsecT s u m a = ParsecT { runParsecT :: State s u -> m (Consumed (m (Reply s u a))) } @@ -62,7 +64,7 @@ data Consumed a = Consumed a | Empty !a -data Reply s u a = Ok !a !(State s u) ParseError +data Reply s u a = Ok a !(State s u) ParseError | Error ParseError data State s u = State { diff -ur parsec-3.0.0/Text/ParserCombinators/Parsec/Expr.hs parsec-3.0.1/Text/ParserCombinators/Parsec/Expr.hs --- parsec-3.0.0/Text/ParserCombinators/Parsec/Expr.hs 2008-03-06 06:28:51.000000000 +0000 +++ parsec-3.0.1/Text/ParserCombinators/Parsec/Expr.hs 2009-09-10 00:04:34.000000000 +0100 @@ -27,12 +27,14 @@ data Operator tok st a = Infix (GenParser tok st (a -> a -> a)) Assoc | Prefix (GenParser tok st (a -> a)) + | Postfix (GenParser tok st (a -> a)) type OperatorTable tok st a = [[Operator tok st a]] convert :: Operator tok st a -> N.Operator [tok] st Identity a convert (Infix p a) = N.Infix p a convert (Prefix p) = N.Prefix p +convert (Postfix p) = N.Postfix p buildExpressionParser :: OperatorTable tok st a -> GenParser tok st a diff -ur parsec-3.0.0/parsec.cabal parsec-3.0.1/parsec.cabal --- parsec-3.0.0/parsec.cabal 2008-03-06 06:28:51.000000000 +0000 +++ parsec-3.0.1/parsec.cabal 2009-09-10 00:04:34.000000000 +0100 @@ -1,6 +1,6 @@ name: parsec -version: 3.0.0 -cabal-version: >= 1.2 +version: 3.0.1 +cabal-version: >= 1.2.3 license: BSD3 license-file: LICENSE author: Daan Leijen , Paolo Martini @@ -17,6 +17,10 @@ stacked on arbitrary monads, and it is also parametric in the input stream type. +flag base4 + Description: Use base-4.* + Default: True + library exposed-modules: Text.Parsec, @@ -42,7 +46,11 @@ Text.ParserCombinators.Parsec.Pos, Text.ParserCombinators.Parsec.Prim, Text.ParserCombinators.Parsec.Token - build-depends: base, mtl, bytestring - extensions: ExistentialQuantification, PolymorphicComponents, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts + if flag(base4) + build-depends: base >= 4 && < 5, syb + else + build-depends: base >= 3.0.3 && < 4 + build-depends: mtl, bytestring + extensions: ExistentialQuantification, PolymorphicComponents, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, DeriveDataTypeable ghc-options: -O2 ghc-prof-options: -auto-all