
29 Jun
2012
29 Jun
'12
10:26 p.m.
On 30 June 2012 07:44, Dan Burton
I could instead imagine the usefulness of alphaPos :: Alphabet -> Char -> Int which indicates what position a given character is in its alphabet (alphaPos English 'a' == 1, for instance), and its inverse alphaFromPos :: Alphabet -> Int -> Char.
I find myself doing something along these lines (but usually with 'a' -> 0) often enough that I would support adding such functions.
But if I am trying to read a number from a String, I would almost certainly want it to fail on encountering any non-hex digit, rather than producing a strange number.
Agreed. -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com