# NOT RUN {
grepl_safe <- function(pattern, x)
{
if (!is.character(pattern)){ return(Err("'pattern' in 'grepl_safe' was not a character value.")) }
if (!is.character(x)){ return(Err("'x' in 'grepl_safe' was not a character value.")) }
Ok(grepl(pattern, x))
}
#grepl_safe(123, 1:5)
# }
Run the code above in your browser using DataLab