-rnCoreExpr (UfVar v)
- = lookupOccRn v `thenRn` \ v' ->
- returnRn (UfVar v')
-
-rnCoreExpr (UfLit l)
- = returnRn (UfLit l)
-
-rnCoreExpr (UfLitLit l ty)
- = rnHsType (text "litlit") ty `thenRn` \ ty' ->
- returnRn (UfLitLit l ty')
-
-rnCoreExpr (UfFCall cc ty)
- = rnHsType (text "ccall") ty `thenRn` \ ty' ->
- returnRn (UfFCall cc ty')
-
-rnCoreExpr (UfTuple (HsTupCon _ boxity arity) args)
- = mapRn rnCoreExpr args `thenRn` \ args' ->
- returnRn (UfTuple (HsTupCon tup_name boxity arity) args')
- where
- tup_name = getName (dataConId (tupleCon boxity arity))
- -- Get the *worker* name and use that
-
-rnCoreExpr (UfApp fun arg)
- = rnCoreExpr fun `thenRn` \ fun' ->
- rnCoreExpr arg `thenRn` \ arg' ->
- returnRn (UfApp fun' arg')
-
-rnCoreExpr (UfCase scrut bndr alts)
- = rnCoreExpr scrut `thenRn` \ scrut' ->
- bindCoreLocalRn bndr $ \ bndr' ->
- mapRn rnCoreAlt alts `thenRn` \ alts' ->
- returnRn (UfCase scrut' bndr' alts')
-
-rnCoreExpr (UfNote note expr)
- = rnNote note `thenRn` \ note' ->
- rnCoreExpr expr `thenRn` \ expr' ->
- returnRn (UfNote note' expr')
-
-rnCoreExpr (UfLam bndr body)
- = rnCoreBndr bndr $ \ bndr' ->
- rnCoreExpr body `thenRn` \ body' ->
- returnRn (UfLam bndr' body')
-
-rnCoreExpr (UfLet (UfNonRec bndr rhs) body)
- = rnCoreExpr rhs `thenRn` \ rhs' ->
- rnCoreBndr bndr $ \ bndr' ->
- rnCoreExpr body `thenRn` \ body' ->
- returnRn (UfLet (UfNonRec bndr' rhs') body')
-
-rnCoreExpr (UfLet (UfRec pairs) body)
- = rnCoreBndrs bndrs $ \ bndrs' ->
- mapRn rnCoreExpr rhss `thenRn` \ rhss' ->
- rnCoreExpr body `thenRn` \ body' ->
- returnRn (UfLet (UfRec (bndrs' `zip` rhss')) body')
- where
- (bndrs, rhss) = unzip pairs
-\end{code}
-
-\begin{code}
-rnCoreBndr (UfValBinder name ty) thing_inside
- = rnHsType doc ty `thenRn` \ 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 `thenRn` \ con' ->
- bindCoreLocalsRn bndrs $ \ bndrs' ->
- rnCoreExpr rhs `thenRn` \ rhs' ->
- returnRn (con', bndrs', rhs')
-
-rnNote (UfCoerce ty)
- = rnHsType (text "unfolding coerce") ty `thenRn` \ ty' ->
- returnRn (UfCoerce ty')
-
-rnNote (UfSCC cc) = returnRn (UfSCC cc)
-rnNote UfInlineCall = returnRn UfInlineCall
-rnNote UfInlineMe = returnRn UfInlineMe
-
-
-rnUfCon UfDefault
- = returnRn UfDefault
-
-rnUfCon (UfTupleAlt (HsTupCon _ boxity arity))
- = returnRn (UfTupleAlt (HsTupCon tup_name boxity arity))
- where
- tup_name = getName (tupleCon boxity arity)
-
-rnUfCon (UfDataAlt con)
- = lookupOccRn con `thenRn` \ con' ->
- returnRn (UfDataAlt con')
-
-rnUfCon (UfLitAlt lit)
- = returnRn (UfLitAlt lit)
-
-rnUfCon (UfLitLitAlt lit ty)
- = rnHsType (text "litlit") ty `thenRn` \ ty' ->
- returnRn (UfLitLitAlt lit ty')
-\end{code}
-
-%*********************************************************
-%* *
-\subsection{Rule shapes}
-%* *