projects
/
matthijs
/
master-project
/
dsd-paper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7cb88fe
)
Make the sumif example fit in a column.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Wed, 27 Jan 2010 15:13:58 +0000
(16:13 +0100)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Wed, 27 Jan 2010 15:13:58 +0000
(16:13 +0100)
cλash.lhs
patch
|
blob
|
history
diff --git
a/cλash.lhs
b/cλash.lhs
index a00112f0d952d111a717545b7671f13d9034bcf2..e824b76d59fc75493b62a462621dd4d031479327 100644
(file)
--- a/
cλash.lhs
+++ b/
cλash.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