Question: 2. Write a Haskell function spanString of type (Char, [Char])>[Char] that takes a character c and a string s as arguments, and returns the substring
2. Write a Haskell function spanString of type (Char, [Char])>[Char] that takes a character c and a string s as arguments, and returns the substring of s before the first occurrence of c. For example, the expression spanString 'b', "ltfb26bym") evaluates to "ltf". Turn in a listing of the function, and the results of this test case
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
