Fix #105
This commit is contained in:
parent
f4a78c0755
commit
ac4b0db5a0
1 changed files with 4 additions and 4 deletions
|
@ -299,8 +299,8 @@ just a couple of lines.
|
|||
Here is the definition of addition in Agda:
|
||||
\begin{code}
|
||||
_+_ : ℕ → ℕ → ℕ
|
||||
zero + n = n
|
||||
suc m + n = suc (m + n)
|
||||
zero + n = n
|
||||
suc m + n = suc (m + n)
|
||||
\end{code}
|
||||
|
||||
Let's unpack this definition. Addition is an infix operator. It is
|
||||
|
@ -431,8 +431,8 @@ Once we have defined addition, we can define multiplication
|
|||
as repeated addition.
|
||||
\begin{code}
|
||||
_*_ : ℕ → ℕ → ℕ
|
||||
zero * n = zero
|
||||
(suc m) * n = n + (m * n)
|
||||
zero * n = zero
|
||||
suc m * n = n + (m * n)
|
||||
\end{code}
|
||||
|
||||
Again, rewriting gives us two familiar equations.
|
||||
|
|
Loading…
Add table
Reference in a new issue