On the following program:
module Bytes
import Data.Fin
%default total
Byte : Type
Byte = Fin 256
fromNat : Nat -> Byte
fromNat n = maybe FZ (\x=>x) (natToFin n 256)
toNat : Byte -> Nat
toNat FZ = Z
toNat (FS b) = S (toNat b)
prop : (b : Byte) -> fromNat (toNat b) = b
prop FZ = ?prop_rhs_1
prop (FS x) = ?prop_rhs_2
The hole ?prop_rhs_1
is not normalizing correctly. Idris says its context is:
--------------------------------------
prop_rhs_1 : maybe (Delay FZ) (Delay (\x => x)) (natToFin _ 256) = FZ
Notice it is displaying (natToFin _ 256)
instead of (natToFin Z 256)
, which should normalize to Just FZ
.