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.

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

1 Expert Approved Answer
Step: 1 Unlock

The code is as ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!