List types

Eric Allen Wohlstadter wohlstad@cs.ucdavis.edu
Sun, 12 Nov 2000 20:12:38 -0800 (PST)


I would like to be able to make a list that contains functions which take
arguments of a certain type 'a'. However I don't know how many 'a'
arguments there are. For example I'd like to be able to make a list of
f,g, and h.

f::a->b
g::a->a->b
h::a->a->a->b
[f,g,h]

Now I could make a function l that takes a list of 'a'.
l::[a]->b
However, I want to be able to curry the a's one at a time.

My solution so far is declare a type Element like this:
data Element a b c d = One a | Two b | Three c | Four d
and then I can make my list like this,
[One f,Two g,Three h]

This gets very ugly. Do you guys have any ideas?

	Eric Wohlstadter
	UCDavis Software Engineering