This is due to the addiction of the function mod(thanks to @AntonTrunov's explanation ). These are polymorphic and default constant numbers Integers.
Idris> :t mod
mod : Integral ty => ty -> ty -> ty
Idris> :t 3
3 : Integer
Idris> :t mod 3 2
mod 3 2 : Integer
For Integera type function is modnot common.
Use instead modNatNZ, so all types are perfectly validated and work.
v1 : modNatNZ 3 2 SIsNotZ = 1
v1 = Refl
source
share