+ \subsubsection{Unused let binding removal}
+ This transformation removes let bindings that are never used.
+ Occasionally, \GHC's desugarer introduces some unused let bindings.
+
+ This normalization pass should really be not be necessary to get
+ into intended normal form (since the intended normal form
+ definition \refdef{intended normal form definition} does not
+ require that every binding is used), but in practice the
+ desugarer or simplifier emits some bindings that cannot be
+ normalized (e.g., calls to a
+ \hs{Control.Exception.Base.patError}) but are not used anywhere
+ either. To prevent the \VHDL\ generation from breaking on these
+ artifacts, this transformation removes them.
+
+ \todo{Do not use old-style numerals in transformations}
+ \starttrans
+ letrec
+ a0 = E0
+ \vdots
+ ai = Ei
+ \vdots
+ an = En
+ in
+ M \lam{ai} does not occur free in \lam{M}
+ ---------------------------- \lam{\forall j, 0 ≤ j ≤ n, j ≠ i} (\lam{ai} does not occur free in \lam{Ej})
+ letrec
+ a0 = E0
+ \vdots
+ ai-1 = Ei-1
+ ai+1 = Ei+1
+ \vdots
+ an = En
+ in
+ M
+ \stoptrans
+
+ % And an example
+ \startbuffer[from]
+ let
+ x = 1
+ in
+ 2
+ \stopbuffer
+
+ \startbuffer[to]
+ let
+ in
+ 2
+ \stopbuffer
+
+ \transexample{unusedlet}{Unused let binding removal}{from}{to}
+