some fixes oops
This commit is contained in:
parent
f9acd13292
commit
87ec03ee5e
1 changed files with 2 additions and 6 deletions
|
@ -217,8 +217,8 @@ def minus : ℕ → ℕ → ℕ =
|
|||
case dup m return ℕ of { [m] ⇒
|
||||
elim-pair (λ _ _ ⇒ ℕ)
|
||||
0
|
||||
(λ _ p ⇒ succ p)
|
||||
(λ _ p ⇒ p)
|
||||
(λ _ p ⇒ succ p)
|
||||
(λ _ _ p ⇒ p)
|
||||
m n
|
||||
}
|
||||
|
@ -311,17 +311,13 @@ namespace char {
|
|||
λ x y ⇒ nat.le (ord x) (ord y)
|
||||
|
||||
def between : ω.Char → ω.Char → ω.Char → Bool =
|
||||
λ lo hi c ⇒
|
||||
case dup c return Bool of { [c] ⇒ bool.and (le lo c) (le c hi) }
|
||||
λ lo hi c ⇒ bool.and (le lo c) (le c hi)
|
||||
|
||||
def is-digit : ω.Char → Bool =
|
||||
between (chr 0x30) (chr 0x39)
|
||||
|
||||
def digit : Char → ℕ =
|
||||
λ c ⇒ nat.minus (ord c) 0x30
|
||||
|
||||
#[compile-scheme "(lambda (c) (builtin-io (display c) (newline)))"]
|
||||
postulate println : Char → IO Unit
|
||||
}
|
||||
|
||||
def0 Char = char.Char
|
||||
|
|
Loading…
Reference in a new issue