@@ -17,7 +17,7 @@ module Language.PureScript.Sugar.Names (
1717) where
1818
1919import Control.Applicative ((<$>))
20−import Control.Monad (foldM)
20+import Control.Monad (foldM, liftM)
2121import Data.Generics (extM, mkM, everywhereM)
2222import qualified Data.Map as M
2323import qualified Data.Set as S
@@ -67,16 +67,16 @@ renameInModule imports (Module mn decls) =
6767 cs' <- updateConstraints cs
6868 return $ TypeInstanceDeclaration cs' cn' ts ds
6969 updateDecl d = return d
70− updateValue (Constructor (Qualified Nothing nm)) = updateDataConstructorName nm >>= return . Constructor
70+ updateValue (Constructor (Qualified Nothing nm)) = liftM Constructor $ updateDataConstructorName nm
7171 updateValue v = return v
72− updateBinder (ConstructorBinder (Qualified Nothing nm) b) = updateDataConstructorName nm >>= return . (`ConstructorBinder` b)
72+ updateBinder (ConstructorBinder (Qualified Nothing nm) b) = liftM (`ConstructorBinder` b) $ updateDataConstructorName nm
7373 updateBinder v = return v
74− updateType (TypeConstructor (Qualified Nothing nm)) = updateTypeName nm >>= return . TypeConstructor
74+ updateType (TypeConstructor (Qualified Nothing nm)) = liftM TypeConstructor $ updateTypeName nm
7575 updateType (SaturatedTypeSynonym (Qualified Nothing nm) tys) = do
7676 nm' <- updateTypeName nm
7777 tys' <- mapM updateType tys
7878 return $ SaturatedTypeSynonym nm' tys'
79− updateType (ConstrainedType cs t) = updateConstraints cs >>= return . (`ConstrainedType` t)
79+ updateType (ConstrainedType cs t) = liftM (`ConstrainedType` t) $ updateConstraints cs
8080 updateType t = return t
8181 updateConstraints = mapM updateConstraint
8282 updateConstraint (Qualified Nothing nm, ts) = do