mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-19 01:01:59 +03:00
commit
2298f8837b
@ -230,8 +230,9 @@ finFromInteger x = natToFinLt (fromInteger x)
|
||||
-- even when the function is unused (issue #2032)
|
||||
public export
|
||||
integerLessThanNat : Integer -> Nat -> Bool
|
||||
integerLessThanNat 0 (S m) = True
|
||||
integerLessThanNat x n with (x < the Integer 0)
|
||||
integerLessThanNat _ _ | True = True -- if `x < 0` then `x < n` for any `n : Nat`
|
||||
integerLessThanNat _ _ | True = False -- don't support negative literals
|
||||
integerLessThanNat x (S m) | False = integerLessThanNat (x-1) m -- recursive case
|
||||
integerLessThanNat x Z | False = False -- `x >= 0` contradicts `x < Z`
|
||||
|
||||
|
@ -20,3 +20,8 @@ eq1 = Refl
|
||||
-- and anybody measures the time it takes this test to run...
|
||||
addFourMillion : Int -> Int
|
||||
addFourMillion x = 4000000 + x
|
||||
|
||||
-- issue #3266
|
||||
failing
|
||||
fin0 : Fin 0
|
||||
fin0 = (-1)
|
||||
|
Loading…
Reference in New Issue
Block a user