mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-11-28 02:23:44 +03:00
[ doc ] Remove typo from Prelude.plus
doc string and
reformat doc string for `Prelude.minus`
This commit is contained in:
parent
4bedaac811
commit
7ec96cea7f
@ -43,14 +43,14 @@ integerToNat x
|
|||||||
-- Define separately so we can spot the name when optimising Nats
|
-- Define separately so we can spot the name when optimising Nats
|
||||||
||| Add two natural numbers.
|
||| Add two natural numbers.
|
||||||
||| @ x the number to case-split on
|
||| @ x the number to case-split on
|
||||||
||| @ y the other numberpublic export
|
||| @ y the other number
|
||||||
public export
|
public export
|
||||||
plus : (x : Nat) -> (y : Nat) -> Nat
|
plus : (x : Nat) -> (y : Nat) -> Nat
|
||||||
plus Z y = y
|
plus Z y = y
|
||||||
plus (S k) y = S (plus k y)
|
plus (S k) y = S (plus k y)
|
||||||
|
|
||||||
||| Subtract natural numbers. If the second number is larger than the first,
|
||| Subtract natural numbers.
|
||||||
||| return 0.
|
||| If the second number is larger than the first, return 0.
|
||||||
public export
|
public export
|
||||||
minus : (left : Nat) -> Nat -> Nat
|
minus : (left : Nat) -> Nat -> Nat
|
||||||
minus Z right = Z
|
minus Z right = Z
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Main> Prelude.plus : Nat -> Nat -> Nat
|
Main> Prelude.plus : Nat -> Nat -> Nat
|
||||||
Add two natural numbers.
|
Add two natural numbers.
|
||||||
@ x the number to case-split on
|
@ x the number to case-split on
|
||||||
@ y the other numberpublic export
|
@ y the other number
|
||||||
Totality: total
|
Totality: total
|
||||||
Visibility: public export
|
Visibility: public export
|
||||||
Main> data Prelude.Nat : Type
|
Main> data Prelude.Nat : Type
|
||||||
|
Loading…
Reference in New Issue
Block a user