Question: a. Write a Haskell function count for counting the number of occurrences of a given character in a string. The type declaration should run:
a. Write a Haskell function count for counting the number of occurrences of a given character in a string. The type declaration should run: count::Char->String->Int. b. Using the count function written above in its infix form and sectioning it together with its second argument, write another Haskell function, countC, that counts the number of occurrences of its single argument of type Char in the given sequence "aabbaac".
Step by Step Solution
3.40 Rating (147 Votes )
There are 3 Steps involved in it
The code is as ... View full answer
Get step-by-step solutions from verified subject matter experts
