Navigation Menu

Skip to content

Commit

Permalink
Fix the Monoid and Semigroup instances (Close issue #15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekmett committed Oct 1, 2013
1 parent 9383422 commit 957ee33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.markdown
@@ -1,3 +1,8 @@
1.2.1
-----
* Bug fix for the `Monoid` instance in response to [issue #15](https://github.com/ekmett/trifecta/issues/14)
* Made the `Semigroup` instance match the `Monoid` as well.

1.2
---
* Changed the `Monoid` instance for `Parser` in response to [issue #14](https://github.com/ekmett/trifecta/issues/14)
Expand Down
6 changes: 3 additions & 3 deletions src/Text/Trifecta/Parser.hs
Expand Up @@ -92,11 +92,11 @@ instance Alternative Parser where
{-# INLINE many #-}
some p = (:) <$> p <*> Alternative.many p

instance Semigroup (Parser a) where
(<>) = (<|>)
instance Semigroup a => Semigroup (Parser a) where
(<>) = liftA2 (<>)
{-# INLINE (<>) #-}

instance Monoid (Parser a) where
instance Monoid a => Monoid (Parser a) where
mappend = liftA2 mappend
{-# INLINE mappend #-}
mempty = pure mempty
Expand Down
2 changes: 1 addition & 1 deletion trifecta.cabal
@@ -1,6 +1,6 @@
name: trifecta
category: Text, Parsing, Diagnostics, Pretty Printer, Logging
version: 1.2
version: 1.2.1
license: BSD3
cabal-version: >= 1.10
license-file: LICENSE
Expand Down

0 comments on commit 957ee33

Please sign in to comment.