From cdeb73b9c1117a3ad288691c40a81a7f96845fe7 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 27 Jan 2010 16:13:58 +0100 Subject: [PATCH 1/1] Make the sumif example fit in a column. --- "c\316\273ash.lhs" | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git "a/c\316\273ash.lhs" "b/c\316\273ash.lhs" index a00112f..e824b76 100644 --- "a/c\316\273ash.lhs" +++ "b/c\316\273ash.lhs" @@ -538,13 +538,14 @@ mac a b c = add (mul a b) c matching and guards. \begin{verbatim} -sumif pred a b = if pred == Eq && a == b || pred == Neq && a != b - then a + b - else 0 +sumif cmp a b = if cmp == Eq && a == b + || cmp == Neq && a != b + then a + b + else 0 \end{verbatim} \begin{verbatim} -sumif pred a b = case pred of +sumif cmp a b = case cmp of Eq -> case a == b of True -> a + b False -> 0 -- 2.30.2