projects
/
matthijs
/
master-project
/
dsd-paper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Start using code instead of verbatim environments for code listings
[matthijs/master-project/dsd-paper.git]
/
cλash.lhs
diff --git
a/cλash.lhs
b/cλash.lhs
index 16608ab610ef2455d2a8172cb8f0889b4b8e09d4..9ec58f1248b54babada9374f6ba49bab47062829 100644
(file)
--- a/
cλash.lhs
+++ b/
cλash.lhs
@@
-370,6
+370,7
@@
\usepackage{paralist}
%include polycode.fmt
\usepackage{paralist}
%include polycode.fmt
+%include clash.fmt
\begin{document}
%
\begin{document}
%
@@
-540,27
+541,24
@@
mac a b c = add (mul a b) c
expression, one using only case expressions and one using pattern
matching and guards.
expression, one using only case expressions and one using pattern
matching and guards.
-\begin{
verbatim
}
-sumif pred a b =
if pred == Eq && a == b || pred == Neq && a != b
-
then a +
b
- else 0
-\end{verbatim}
+\begin{
code
}
+sumif pred a b =
+
if pred == Eq && a == b || pred == Neq && a !=
b
+ then a + b
+ else 0
-\begin{verbatim}
sumif pred a b = case pred of
sumif pred a b = case pred of
- Eq -> case a == b of
- True -> a + b
- False -> 0
- Neq -> case a != b of
- True -> a + b
- False -> 0
-\end{verbatim}
-
-\begin{verbatim}
-sumif Eq a b | a == b = a + b
-sumif Neq a b | a != b = a + b
-sumif _ _ _ = 0
-\end{verbatim}
+ Eq -> case a == b of
+ True -> a + b
+ False -> 0
+ Neq -> case a != b of
+ True -> a + b
+ False -> 0
+
+sumif Eq a b | a == b = a + b
+sumif Neq a b | a != b = a + b
+sumif _ _ _ = 0
+\end{code}
TODO: Pretty picture
TODO: Pretty picture