- checkSigTyVars inst_tyvars'
-
- -- Deal with 'SPECIALISE instance' pragmas
- prags <- tcPrags dfun_id (filter isSpecInstLSig uprags)
-
- -- Create the result bindings
- let
- dict_constr = classDataCon clas
- inline_prag | null dfun_dicts = []
- | otherwise = [L loc (InlinePrag (Inline AlwaysActive True))]
- -- Always inline the dfun; this is an experimental decision
- -- because it makes a big performance difference sometimes.
- -- Often it means we can do the method selection, and then
- -- inline the method as well. Marcin's idea; see comments below.
- --
- -- BUT: don't inline it if it's a constant dictionary;
- -- we'll get all the benefit without inlining, and we get
- -- a **lot** of code duplication if we inline it
- --
- -- See Note [Inline dfuns] below
-
- sc_dict_vars = map instToVar sc_dicts
- dict_bind = L loc (VarBind this_dict_id dict_rhs)
- dict_rhs = foldl (\ f a -> L loc (HsApp f (L loc a))) inst_constr meth_exprs
- inst_constr = L loc $ wrapId (mkWpApps sc_dict_vars <.> mkWpTyApps inst_tys')
- (dataConWrapId dict_constr)
- -- We don't produce a binding for the dict_constr; instead we
- -- rely on the simplifier to unfold this saturated application
- -- We do this rather than generate an HsCon directly, because
- -- it means that the special cases (e.g. dictionary with only one
- -- member) are dealt with by the common MkId.mkDataConWrapId code rather
- -- than needing to be repeated here.
-
-
- main_bind = noLoc $ AbsBinds
- inst_tyvars'
- dfun_lam_vars
- [(inst_tyvars', dfun_id, this_dict_id, inline_prag ++ prags)]
- (dict_bind `consBag` sc_binds)
-
- showLIE (text "instance")
- return (main_bind `consBag` unionManyBags meth_binds)
+ ; checkSigTyVars inst_tyvars'
+
+ -- Deal with 'SPECIALISE instance' pragmas
+ ; prags <- tcPrags dfun_id (filter isSpecInstLSig uprags)
+
+ -- Create the result bindings
+ ; let dict_constr = classDataCon clas
+ inline_prag | null dfun_dicts = []
+ | otherwise = [L loc (InlinePrag (Inline AlwaysActive True))]
+ -- Always inline the dfun; this is an experimental decision
+ -- because it makes a big performance difference sometimes.
+ -- Often it means we can do the method selection, and then
+ -- inline the method as well. Marcin's idea; see comments below.
+ --
+ -- BUT: don't inline it if it's a constant dictionary;
+ -- we'll get all the benefit without inlining, and we get
+ -- a **lot** of code duplication if we inline it
+ --
+ -- See Note [Inline dfuns] below
+
+ sc_dict_vars = map instToVar sc_dicts
+ dict_bind = L loc (VarBind this_dict_id dict_rhs)
+ dict_rhs = foldl (\ f a -> L loc (HsApp f (L loc a))) inst_constr meth_exprs
+ inst_constr = L loc $ wrapId (mkWpApps sc_dict_vars <.> mkWpTyApps inst_tys')
+ (dataConWrapId dict_constr)
+ -- We don't produce a binding for the dict_constr; instead we
+ -- rely on the simplifier to unfold this saturated application
+ -- We do this rather than generate an HsCon directly, because
+ -- it means that the special cases (e.g. dictionary with only one
+ -- member) are dealt with by the common MkId.mkDataConWrapId code rather
+ -- than needing to be repeated here.
+
+
+ main_bind = noLoc $ AbsBinds
+ inst_tyvars'
+ dfun_lam_vars
+ [(inst_tyvars', dfun_id, this_dict_id, inline_prag ++ prags)]
+ (dict_bind `consBag` sc_binds)
+
+ ; showLIE (text "instance")
+ ; return (main_bind `consBag` unionManyBags meth_binds) }