There is a list of String ["f", "1", "h", "6", "b", "7"].
How can I count Int in this list?
Now I have this algorithm but it's not so good.
import Data.Char
let listOfStrings = ["f", "1", "h", "6", "b", "7"]
let convertedString = "f1h6b7"
let listOfInt = map (\x -> read [x]::Int) (filter (\x -> isDigit x) convertedString)
length listOfInt
Prelude> 3
Besides, I can't convert listOfStrings to one string. This algorithm doesn't even work properly
Can you help me with optimization?
Strings in the list that are representations of integers (in base 10?), did I understand that correctly? Only non-negative integers or also negative?