Fix a terrible bug in MonadState's state #1

Merged
merged 3 commits into from Apr 23, 2012
@@ -21,7 +21,7 @@
-----------------------------------------------------------------------------
module Control.Monad.RWS.Class (
- MonadRWS(..),
+ MonadRWS,
module Control.Monad.Reader.Class,
module Control.Monad.State.Class,
module Control.Monad.Writer.Class,
@@ -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.
View
@@ -47,3 +47,4 @@ Library
MultiParamTypeClasses
FunctionalDependencies
FlexibleInstances
+ ghc-options: -Wall -fno-warn-unused-imports