module RnSource ( rnDecl, rnHsType, rnHsSigType ) where
+IMPORT_1_3(List(partition))
IMP_Ubiq()
+
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ <= 201
IMPORT_DELOOPER(RnLoop) -- *check* the RnPass/RnExpr/RnBinds loop-breaking
-IMPORT_1_3(List(partition))
+#else
+import {-# SOURCE #-} RnExpr
+#endif
import HsSyn
import HsDecls ( HsIdInfo(..) )
= pushSrcLocRn loc $
lookupBndrRn name `thenRn` \ name' ->
rnHsType ty `thenRn` \ ty' ->
-
- -- Get the pragma info, unless we should ignore it
- (if opt_IgnoreIfacePragmas then
- returnRn []
- else
- setModeRn (InterfaceMode Optional) $
- -- In all the rest of the signature we read in optional mode,
- -- so that (a) we don't die
- mapRn rnIdInfo id_infos
- ) `thenRn` \ id_infos' ->
-
+ -- Get the pragma info (if any).
+ setModeRn (InterfaceMode Optional) $
+ -- In all the rest of the signature we read in optional mode,
+ -- so that (a) we don't die
+ mapRn rnIdInfo id_infos `thenRn` \ id_infos' ->
returnRn (SigD (IfaceSig name' ty' id_infos' loc))
\end{code}
\begin{code}
rnDecl (ClD (ClassDecl context cname tyvar sigs mbinds pragmas src_loc))
= pushSrcLocRn src_loc $
- bindTyVarsRn cls_doc [tyvar] $ \ [tyvar'] ->
- rnContext context `thenRn` \ context' ->
- lookupBndrRn cname `thenRn` \ cname' ->
-
- -- Check the signatures
- checkDupOrQualNames sig_doc sig_names `thenRn_`
- mapRn (rn_op cname' (getTyVarName tyvar')) sigs `thenRn` \ sigs' ->
-
+ bindTyVarsRn cls_doc [tyvar] ( \ [tyvar'] ->
+ rnContext context `thenRn` \ context' ->
+ lookupBndrRn cname `thenRn` \ cname' ->
+
+ -- Check the signatures
+ checkDupOrQualNames sig_doc sig_names `thenRn_`
+ mapRn (rn_op cname' (getTyVarName tyvar')) sigs `thenRn` \ sigs' ->
+ returnRn (tyvar', context', cname', sigs')
+ ) `thenRn` \ (tyvar', context', cname', sigs') ->
-- Check the methods
checkDupOrQualNames meth_doc meth_names `thenRn_`