Solved

# Haskell Question

Posted on 2002-05-26

Hi

I got a Haskell exam in a few days and doing the pastpaper of it. Since the anwer of it is not given

it would be very helpful if anyone could check some of my answer which I am not sure about, and answer

the questions which I have no idea...

Thank you very much

asukai

(a) What is a qualified type in Haskell?

My answer:

Qualified type is a type which consist of more than one type. For instance, Integral a=> a-> a is a

qualified type where Integral is type class whose element is int and Integer.

(b) What are the types of the following Haskell functions?

(i) one x y = x < y

My answer:

Boolean

(ii) two x y = x + y

Real

(iii) three x y = xy

Real

(iv) four x y = x + + y

List

(v) five x y = x ! ! y

An element of List. Eq. (not sure)

(vi) six x y = x = = y

boolean.

(c) In the context of a functional programming language what is a homomorphism?

No idea.

(a) Discuss the advantages and disadvantages of pure functional programming

languages as compared with other sorts of language.

Advantages:

Good programming practise.

Simpler and shorter code.

Anything else?

Disadvantages:

Not flexible.

Strict Syntax. Need to specify type for each function.

Limited libeary.

It only deals with calculation problem.

Anything else?