My original code is given below and works fine. I wanted to add range check of 'ind' and in the modified version I added an if statement. When I run it I get a "type error in conditional", and I THINK its because of the output defintion [[String]] not IO()?
Is there anyother way to check for the range of the value held in ind
and produce an output like "error"/"outofrange" ?
original code
retrieve :: [Int] -> [[String]] -> [[String]]
retrieve [] dat = [[]]
retrieve ind dat = [exC ind d | d <- dat]
modified code
retrieve :: [Int] -> [[String]] -> [[String]]
retrieve [] dat = [[]]
retrieve ind dat = if ind>3
then putStrLn "not found"
else [exC ind d | d <- dat]
thanks,