+\subsection{Foreign declarations}
+%* *
+%*********************************************************
+
+\begin{code}
+rnDecl (ForD (ForeignDecl name imp_exp ty ext_nm cconv src_loc))
+ = pushSrcLocRn src_loc $
+ lookupBndrRn name `thenRn` \ name' ->
+ (if is_export then
+ addImplicitOccRn name'
+ else
+ returnRn name') `thenRn_`
+ rnHsSigType fo_decl_msg ty `thenRn` \ ty' ->
+ returnRn (ForD (ForeignDecl name' imp_exp ty' ext_nm cconv src_loc))
+ where
+ fo_decl_msg = ptext SLIT("a foreign declaration")
+ is_export = not (maybeToBool imp_exp) && not (isDynamic ext_nm)
+
+\end{code}
+
+%*********************************************************
+%* *