Skip to content

Commit

Permalink
Inline applicative operators
Browse files Browse the repository at this point in the history
  • Loading branch information
szumixie authored and mrkkrp committed Aug 8, 2024
1 parent 1160ac8 commit c8c9fb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Implemented correct handling of wide Unicode characters in error messages.
To that end, a new module `Text.Megaparsec.Unicode` was introduced. [Issue
370](https://github.com/mrkkrp/megaparsec/issues/370).
* Inlined `Applicative` operators `(<*)` and `(*>)`. [PR
566](https://github.com/mrkkrp/megaparsec/pull/566).

## Megaparsec 9.6.1

Expand Down
2 changes: 2 additions & 0 deletions Text/Megaparsec/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ instance (Stream s) => Applicative (ParsecT e s m) where
pure = pPure
(<*>) = pAp
p1 *> p2 = p1 `pBind` const p2
{-# INLINE (*>) #-}
p1 <* p2 = do x1 <- p1; void p2; return x1
{-# INLINE (<*) #-}

pPure :: (Stream s) => a -> ParsecT e s m a
pPure x = ParsecT $ \s _ _ eok _ -> eok x s mempty
Expand Down

0 comments on commit c8c9fb0

Please sign in to comment.