Solved

Posted on 2002-05-26
171 Views
Hi
I got a Haskell exam in a few days and doing the pastpaper of it. Since the anwer of it is not given
the questions which I have no idea...
Thank you very much
asukai

(a) What is a qualified type in Haskell?
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
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.
languages as compared with other sorts of language.

Good programming practise.
Simpler and shorter code.

Anything else?

Not flexible.
Strict Syntax. Need to specify type for each function.
Limited libeary.
It only deals with calculation problem.
Anything else?
0
Question by:asukai
• 2

LVL 6

Expert Comment

ID: 7048235

the ++ is "infix"

For number two, are you looking for "add" or "Lambda Abstractions"?

Check out these pages:
http://www.cse.unsw.edu.au/~paull/cs1011/inbuilt.html
0

LVL 6

Accepted Solution

Triskelion earned 100 total points
ID: 7048264
0

LVL 2

Expert Comment

ID: 7186969
(v) five x y = x ! ! y
An element of List. Eq. (not sure)
----------------------------------
type of list x

Good programming practise.
Simpler and shorter code.

Anything else?
----------------------------------
Ability to follow mathmatical arguments? (maybe)
I disagree with good programming practise, good recursion practise maybe, not general programming practise.

(c) In the context of a functional programming language what is a homomorphism
----------------------------------
I forgot!!

Dech

0

Expert Comment

ID: 9314523
asukai:
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

## Featured Post

### Suggested Solutions

This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

#### Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!