diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2015-12-05 00:29:55 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2015-12-05 00:29:55 +0100 |
commit | a6deefad581cbeb62048826bc1d626c41a0dd56c (patch) | |
tree | 813e11ee7e5310b593d830ed395da3c059efb1b9 /haddock-library/vendor/attoparsec-0.12.1.1/Data | |
parent | 42b2cfc595f1ee62d1c1b8513c5df1d92709c06a (diff) |
Canonicalise Monad instances
Diffstat (limited to 'haddock-library/vendor/attoparsec-0.12.1.1/Data')
-rw-r--r-- | haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal/Types.hs | 6 |
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 (<*) #-} |