detectIllegalValues :: (HasLegalValues t) => String -> t -> t
detectIllegalValues contextDescription value =
    case maybeGetProblem value of
        Nothing -> value
        Just problemDescription ->   
            throw $ AERNIllegalValue $ 
                contextDescription ++ ": " ++ problemDescription
detectIllegalValues :: (HasLegalValues t) => String -> t -> t
detectIllegalValues contextDescription value =
    case maybeGetProblem value of
        Nothing -> value
        Just problemDescription ->   
            throw $ AERNIllegalValue $ 
                contextDescription ++ ": " ++ problemDescription
detectIllegalValues contextDescription value =
    case maybeGetProblem value of
        Nothing -> value
        Just problemDescription ->   
            throw $ AERNIllegalValue $ 
                contextDescription ++ ": " ++ problemDescription