2021-06-11 14:37:45 +03:00
|
|
|
module CoverBug
|
|
|
|
|
|
|
|
import Data.So
|
|
|
|
|
|
|
|
public export
|
|
|
|
data FastNat : Type where
|
|
|
|
MkFastNat : (val : Integer) -> {auto 0 prf : So True} -> FastNat
|
2021-06-11 14:46:08 +03:00
|
|
|
|
2021-06-11 14:37:45 +03:00
|
|
|
prv1 : Integer -> (x : Integer ** So $ True)
|
2021-06-11 14:43:34 +03:00
|
|
|
prv1 x =
|
2021-06-11 14:37:45 +03:00
|
|
|
case choose True of
|
|
|
|
Left prf => (x ** Oh)
|
|
|
|
Right noprf => absurd noprf
|
|
|
|
|
|
|
|
fromInteger : Integer -> FastNat
|
2021-06-11 14:43:34 +03:00
|
|
|
fromInteger v =
|
2021-06-11 14:37:45 +03:00
|
|
|
let (v ** p) = prv1 $ v
|
|
|
|
in MkFastNat v
|
2021-06-11 14:46:08 +03:00
|
|
|
|
2021-06-11 14:37:45 +03:00
|
|
|
doit : FastNat -> FastNat
|
|
|
|
doit 0 = 0
|