[Solved] How to find occurrences of char in an input string in Haskell
There are many ways to do this, but since you mention you’re a Haskell beginner, a list comprehension may be easiest to understand (I’m assuming this is homework, so you have to implement it yourself, not use elemIndices): stringCount str ch = [ y | (x, y) <- zip str [0..], x == ch ] … Read more