Check if the last digit in a sequence of digits is a valid check digit for the sequence according to the Modulus 10 algorithm.
hasValidCheckDigit [ 1, 2, 3 ] == Ok False
hasValidCheckDigit [ -2, 3 4 ] == Err NumbersOutOfRange
hasValidCheckDigit [] == Err EmptySequencecalculateCheckDigit the check digit for a given sequence of digits.
The Modulus 10 algorithm works on sequences of digits, but since boths lists and integers can represent values that are invalid in this context there are some cases that will result in errors.