+ \placeintermezzo{}{
+ \defref{wild binders}
+ \startframedtext[width=7cm,background=box,frame=no]
+ \startalignment[center]
+ {\tfa Wild binders}
+ \stopalignment
+ \blank[medium]
+ In a functional expression, a \emph{wild binder} refers to any
+ binder that is never referenced. This means that even though it
+ will be bound to a particular value, that value is never used.
+
+ The Haskell syntax offers the underscore as a wild binder that
+ cannot even be referenced (It can be seen as introducing a new,
+ anonymous, binder everytime it is used).
+
+ In these transformations, the term wild binder will sometimes be
+ used to indicate that a binder must not be referenced.
+ \stopframedtext
+ }
+
+ \subsubsection{Scrutinee binder removal}
+ This transformation removes (or rather, makes wild) the binder to
+ which the scrutinee is bound after evaluation. This is done by
+ replacing the bndr with the scrutinee in all alternatives. To prevent
+ duplication of work, this transformation is only applied when the
+ scrutinee is already a simple variable reference (but the previous
+ transformation ensures this will eventually be the case). The
+ scrutinee binder itself is replaced by a wild binder (which is no
+ longer displayed).
+
+ Note that one could argue that this transformation can change the
+ meaning of the Core expression. In the regular Core semantics, a case
+ expression forces the evaluation of its scrutinee and can be used to
+ implement strict evaluation. However, in the generated \VHDL,
+ evaluation is always strict. So the semantics we assign to the Core
+ expression (which differ only at this particular point), this
+ transformation is completely valid.
+
+ \starttrans
+ case x of bndr
+ alts
+ ----------------- \lam{x} is a local variable reference
+ case x of
+ alts[bndr=>x]
+ \stoptrans
+
+ \startbuffer[from]
+ case x of y
+ True -> y
+ False -> not y
+ \stopbuffer
+
+ \startbuffer[to]
+ case x of
+ True -> x
+ False -> not x
+ \stopbuffer
+
+ \transexample{scrutbndrremove}{Scrutinee binder removal}{from}{to}
+