From 5f94742c1854c1d5f47d4e89f8d96bc74d1b20c9 Mon Sep 17 00:00:00 2001 From: Christiaan Baaij Date: Thu, 25 Feb 2010 16:27:07 +0100 Subject: [PATCH] fix layout of choice section --- "c\316\273ash.lhs" | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git "a/c\316\273ash.lhs" "b/c\316\273ash.lhs" index 7673139..438cce4 100644 --- "a/c\316\273ash.lhs" +++ "b/c\316\273ash.lhs" @@ -606,10 +606,7 @@ by an (optimizing) \VHDL\ synthesis tool. % against the constructors in the \hs{case} expressions. We can see two versions of a contrived example below, the first using a \hs{case} construct and the other using a \hs{if-then-else} - constructs, in the code below. The example sums two values when they are - equal or non-equal (depending on the predicate given) and returns 0 - otherwise. Both versions of the example roughly correspond to the same - netlist, which is depicted in \Cref{img:choice}. + constructs, in the code below. \begin{code} sumif pred a b = case pred of @@ -634,6 +631,11 @@ by an (optimizing) \VHDL\ synthesis tool. \caption{Choice - sumif} \label{img:choice} \end{figure} + + The example sums two values when they are equal or non-equal (depending on + the predicate given) and returns 0 otherwise. Both versions of the example + roughly correspond to the same netlist, which is depicted in + \Cref{img:choice}. A slightly more complex (but very powerful) form of choice is pattern matching. A function can be defined in multiple clauses, where each clause -- 2.30.2