aboutsummaryrefslogtreecommitdiff
path: root/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2015-12-05 00:29:55 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2015-12-14 15:54:22 +0000
commit3f503bd54678ec9ea611ba81360b573eb745e7b0 (patch)
tree30ca0a1a452915d9f63484397ae20d94decbf2c9 /haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal
parentf310809a04592f8841583a2e146021d68f9a8432 (diff)
Canonicalise Monad instances
Diffstat (limited to 'haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal')
-rw-r--r--haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal/Types.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal/Types.hs b/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal/Types.hs
index 6719e09a..9c7994e9 100644
--- a/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal/Types.hs
+++ b/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal/Types.hs
@@ -126,7 +126,7 @@ instance Monad (Parser i) where
where msg = "Failed reading: " ++ err
{-# INLINE fail #-}
- return v = Parser $ \t pos more _lose succ -> succ t pos more v
+ return = pure
{-# INLINE return #-}
m >>= k = Parser $ \t !pos more lose succ ->
@@ -158,7 +158,7 @@ apP d e = do
{-# INLINE apP #-}
instance Applicative (Parser i) where
- pure = return
+ pure v = Parser $ \t pos more _lose succ -> succ t pos more v
{-# INLINE pure #-}
(<*>) = apP
{-# INLINE (<*>) #-}
@@ -166,7 +166,7 @@ instance Applicative (Parser i) where
-- These definitions are equal to the defaults, but this
-- way the optimizer doesn't have to work so hard to figure
-- that out.
- (*>) = (>>)
+ m *> k = m >>= \_ -> k
{-# INLINE (*>) #-}
x <* y = x >>= \a -> y >> return a
{-# INLINE (<*) #-}