Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

8. (15) (a) What is the type of the following unknown9 function? Give the most general type and include any required class constraints. The function

8. (15) (a) What is the type of the following unknown9 function? Give the most general type and include any required class constraints. The function length returns type Int.

> unknown9 [] = [] > unknown9 (x:xs) = (a , x) : b > where > a = length $ x : takeWhile (==x) xs > b = unknown9 (dropWhile (==x) xs)

(b) Give a description of what the unknown9 function in part (a) does. Describe what it does, not how it works.

(c) Give a non-trivial test case for the unknown8 function in part (a) and show the expected results.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions