list - Haskell recursion odd -


i have define own predicate function recursively searches list of numbers , returns true if finds odd number, false otherwise.

i have set x = [1..100] test data need show. however, bit unsure how recursion search list. i'm not looking definitive answer explanation on how recursion go around searching in list.

what want function any odd:

any :: (a -> bool) -> [a] -> bool  odd :: integral => -> bool  odd :: integral => [a] -> bool  anyodd :: integral => [a] -> bool anyodd = odd 

if want define anyodd function have use recursion:

anyodd :: integral => [a] -> bool anyodd []       = undefined anyodd (x:xs)     | odd x     = undefined     | otherwise = undefined 

you need replace undefined actual logic.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -