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

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

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!