Typechecking class declarations
\begin{code}
-{-# OPTIONS_GHC -w #-}
+{-# OPTIONS -w #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and fix
-- any warnings in the module. See
--- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings
+-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
-- for details
module TcClassDcl ( tcClassSigs, tcClassDecl2,
import BasicTypes
import Bag
import FastString
+
+import Control.Monad
\end{code}
-- The renamer just puts the selector ID as the binder in the method binding
-- but we must use the method name; so we substitute it here. Crude but simple.
find_bind sel_name meth_name binds
- = foldlBag seqMaybe Nothing (mapBag f binds)
+ = foldlBag mplus Nothing (mapBag f binds)
where
f (L loc1 bind@(FunBind { fun_id = L loc2 op_name })) | op_name == sel_name
= Just (L loc1 (bind { fun_id = L loc2 meth_name }))