mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-28 22:22:10 +03:00
[minor] Make base/Data.Nat.divNatNZ
compile-time reducible (#689)
Co-authored-by: Ohad Kammar <ohad.kammar@ed.ac.uk>
This commit is contained in:
parent
c4abdb4480
commit
e77b9b4631
@ -187,11 +187,13 @@ export partial
|
||||
modNat : Nat -> Nat -> Nat
|
||||
modNat left (S right) = modNatNZ left (S right) SIsNotZ
|
||||
|
||||
export partial
|
||||
-- 'public' to allow type-level division
|
||||
public export total
|
||||
divNatNZ : Nat -> (y: Nat) -> Not (y = Z) -> Nat
|
||||
divNatNZ left Z p = void (p Refl)
|
||||
divNatNZ left (S right) _ = div' left left right
|
||||
where
|
||||
public export
|
||||
div' : Nat -> Nat -> Nat -> Nat
|
||||
div' Z centre right = Z
|
||||
div' (S left) centre right =
|
||||
|
Loading…
Reference in New Issue
Block a user