-%*********************************************************
-%* *
-\subsection{IdInfo}
-%* *
-%*********************************************************
-
-\begin{code}
-rnIdInfo (HsWorker worker arity)
- = lookupOccRn worker `thenM` \ worker' ->
- returnM (HsWorker worker' arity)
-
-rnIdInfo (HsUnfold inline expr) = rnCoreExpr expr `thenM` \ expr' ->
- returnM (HsUnfold inline expr')
-rnIdInfo (HsStrictness str) = returnM (HsStrictness str)
-rnIdInfo (HsArity arity) = returnM (HsArity arity)
-rnIdInfo HsNoCafRefs = returnM HsNoCafRefs
-\end{code}
-
-@UfCore@ expressions.
-
-\begin{code}
-rnCoreExpr (UfType ty)
- = rnHsType (text "unfolding type") ty `thenM` \ ty' ->
- returnM (UfType ty')
-
-rnCoreExpr (UfVar v)
- = lookupOccRn v `thenM` \ v' ->
- returnM (UfVar v')
-
-rnCoreExpr (UfLit l)
- = returnM (UfLit l)
-
-rnCoreExpr (UfLitLit l ty)
- = rnHsType (text "litlit") ty `thenM` \ ty' ->
- returnM (UfLitLit l ty')
-
-rnCoreExpr (UfFCall cc ty)
- = rnHsType (text "ccall") ty `thenM` \ ty' ->
- returnM (UfFCall cc ty')
-
-rnCoreExpr (UfTuple (HsTupCon boxity arity) args)
- = mappM rnCoreExpr args `thenM` \ args' ->
- returnM (UfTuple (HsTupCon boxity arity) args')
-
-rnCoreExpr (UfApp fun arg)
- = rnCoreExpr fun `thenM` \ fun' ->
- rnCoreExpr arg `thenM` \ arg' ->
- returnM (UfApp fun' arg')
-
-rnCoreExpr (UfCase scrut bndr alts)
- = rnCoreExpr scrut `thenM` \ scrut' ->
- bindCoreLocalRn bndr $ \ bndr' ->
- mappM rnCoreAlt alts `thenM` \ alts' ->
- returnM (UfCase scrut' bndr' alts')
-
-rnCoreExpr (UfNote note expr)
- = rnNote note `thenM` \ note' ->
- rnCoreExpr expr `thenM` \ expr' ->
- returnM (UfNote note' expr')
-
-rnCoreExpr (UfLam bndr body)
- = rnCoreBndr bndr $ \ bndr' ->
- rnCoreExpr body `thenM` \ body' ->
- returnM (UfLam bndr' body')
-
-rnCoreExpr (UfLet (UfNonRec bndr rhs) body)
- = rnCoreExpr rhs `thenM` \ rhs' ->
- rnCoreBndr bndr $ \ bndr' ->
- rnCoreExpr body `thenM` \ body' ->
- returnM (UfLet (UfNonRec bndr' rhs') body')
-
-rnCoreExpr (UfLet (UfRec pairs) body)
- = rnCoreBndrs bndrs $ \ bndrs' ->
- mappM rnCoreExpr rhss `thenM` \ rhss' ->
- rnCoreExpr body `thenM` \ body' ->
- returnM (UfLet (UfRec (bndrs' `zip` rhss')) body')
- where
- (bndrs, rhss) = unzip pairs
-\end{code}
-
-\begin{code}
-rnCoreBndr (UfValBinder name ty) thing_inside
- = rnHsType doc ty `thenM` \ ty' ->
- bindCoreLocalRn name $ \ name' ->
- thing_inside (UfValBinder name' ty')
- where
- doc = text "unfolding id"
-
-rnCoreBndr (UfTyBinder name kind) thing_inside
- = bindCoreLocalRn name $ \ name' ->
- thing_inside (UfTyBinder name' kind)
-
-rnCoreBndrs [] thing_inside = thing_inside []
-rnCoreBndrs (b:bs) thing_inside = rnCoreBndr b $ \ name' ->
- rnCoreBndrs bs $ \ names' ->
- thing_inside (name':names')
-\end{code}
-
-\begin{code}
-rnCoreAlt (con, bndrs, rhs)
- = rnUfCon con `thenM` \ con' ->
- bindCoreLocalsRn bndrs $ \ bndrs' ->
- rnCoreExpr rhs `thenM` \ rhs' ->
- returnM (con', bndrs', rhs')
-
-rnNote (UfCoerce ty)
- = rnHsType (text "unfolding coerce") ty `thenM` \ ty' ->
- returnM (UfCoerce ty')
-
-rnNote (UfSCC cc) = returnM (UfSCC cc)
-rnNote UfInlineCall = returnM UfInlineCall
-rnNote UfInlineMe = returnM UfInlineMe
-rnNote (UfCoreNote s) = returnM (UfCoreNote s)
-
-rnUfCon UfDefault
- = returnM UfDefault
-
-rnUfCon (UfTupleAlt tup_con)
- = returnM (UfTupleAlt tup_con)
-
-rnUfCon (UfDataAlt con)
- = lookupOccRn con `thenM` \ con' ->
- returnM (UfDataAlt con')
-
-rnUfCon (UfLitAlt lit)
- = returnM (UfLitAlt lit)
-
-rnUfCon (UfLitLitAlt lit ty)
- = rnHsType (text "litlit") ty `thenM` \ ty' ->
- returnM (UfLitLitAlt lit ty')
-\end{code}