Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fix horrible mistake in MonadState.state's default definition.

This is a trivial mistake in the sense that -Wall gives two
warnings about it:

      Warning: Defined but not used: `s'

      Warning: This binding for `s' shadows the existing binding
                 bound at Control/Monad/State/Class.hs:62:7

However, it caused a very hard-to-track bug in a completely
unrelated library (fb, which depends on http-conduit, which
depends on tls, which depends on mtl).
  • Loading branch information...
commit a60fc2695c5e1bfe72e564c53b88ef266957a00d 1 parent 05b0bf2
@meteficha meteficha authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 Control/Monad/State/Class.hs
4 Control/Monad/State/Class.hs
@@ -60,8 +60,8 @@ class Monad m => MonadState s m | m -> s where
state :: (s -> (a, s)) -> m a
state f = do
s <- get
- let ~(a, s) = f s
- put s
+ let ~(a, s') = f s
+ put s'
return a
-- | Monadic state transformer.

0 comments on commit a60fc26

Please sign in to comment.
Something went wrong with that request. Please try again.