How to prove that a string is in hexadecimal format?
问题 How can I use Idris to build a function that, given a string, returns a proof that such String is hexadecimal (i.e., 0x followed by 2*N characters from 0-9 and a-f , such as "0x1a7f33b8" )? What I tried First, I've constructed the following type for hex chars: data IsNib : Char -> Type where IsNib0 : IsNib '0' IsNib1 : IsNib '1' IsNib2 : IsNib '2' IsNib3 : IsNib '3' IsNib4 : IsNib '4' IsNib5 : IsNib '5' IsNib6 : IsNib '6' IsNib7 : IsNib '7' IsNib8 : IsNib '8' IsNib9 : IsNib '9' IsNibA : IsNib