like that, so we use a BuiltinRule instead, so that we
can match in any two literal values. So the rule is really
more like
like that, so we use a BuiltinRule instead, so that we
can match in any two literal values. So the rule is really
more like
where the (+#) on the rhs is done at compile time
That is why these rules are built in here. Other rules
where the (+#) on the rhs is done at compile time
That is why these rules are built in here. Other rules
dataToTagRule :: IdUnfoldingFun -> [Expr CoreBndr] -> Maybe (Arg CoreBndr)
dataToTagRule _ [Type ty1, Var tag_to_enum `App` Type ty2 `App` tag]
| tag_to_enum `hasKey` tagToEnumKey
dataToTagRule :: IdUnfoldingFun -> [Expr CoreBndr] -> Maybe (Arg CoreBndr)
dataToTagRule _ [Type ty1, Var tag_to_enum `App` Type ty2 `App` tag]
| tag_to_enum `hasKey` tagToEnumKey
= Just tag -- dataToTag (tagToEnum x) ==> x
dataToTagRule id_unf [_, val_arg]
= Just tag -- dataToTag (tagToEnum x) ==> x
dataToTagRule id_unf [_, val_arg]