- = setSrcSpan loc $
- lookupInstDeclBndr cls name `thenM` \ sel_name ->
- let plain_name = unLoc sel_name in
- -- We use the selector name as the binder
-
- bindSigTyVarsFV (sig_fn plain_name) $
- mapFvRn (rn_match plain_name) matches `thenM` \ (new_matches, fvs) ->
- let
- new_group = MatchGroup new_matches placeHolderType
- in
- checkPrecMatch inf plain_name new_group `thenM_`
- returnM (unitBag (L loc (FunBind {
- fun_id = sel_name, fun_infix = inf,
- fun_matches = new_group,
- bind_fvs = fvs, fun_co_fn = idHsWrapper,
- fun_tick = Nothing })),
- fvs `addOneFV` plain_name)
- -- The 'fvs' field isn't used for method binds
+ = setSrcSpan loc $ do
+ sel_name <- lookupInstDeclBndr cls name
+ let plain_name = unLoc sel_name
+ -- We use the selector name as the binder
+
+ bindSigTyVarsFV (sig_fn plain_name) $ do
+ (new_matches, fvs) <- mapFvRn (rn_match plain_name) matches
+ let
+ new_group = MatchGroup new_matches placeHolderType
+
+ checkPrecMatch inf plain_name new_group
+ return (unitBag (L loc (FunBind {
+ fun_id = sel_name, fun_infix = inf,
+ fun_matches = new_group,
+ bind_fvs = fvs, fun_co_fn = idHsWrapper,
+ fun_tick = Nothing })),
+ fvs `addOneFV` plain_name)
+ -- The 'fvs' field isn't used for method binds