Partial decoding into a finite type #
Fin.ofNat? n x decodes x as an element of Fin n when it is in range and returns none
otherwise.
Main definitions #
Fin.ofNat?: the partial decoder from natural numbers toFin.
Main results #
Fin.ofNat?_eq_some_of_lt,Fin.ofNat?_eq_none_of_not_lt: exact success and failure laws.
References #
This elementary decoder is original to this module.