How can I parameterize the Candidate?

Hello, How can I parameterize the type of the following data class so that any type can be a Candidate? type Candidate = String data Poll = Poll [Candidate] [Ballot] My initial thought was to simply put a type variable in place of Candidate, but that clearly won't work: data Poll = Poll [a] [Ballot]
Not in scope: type variable `a' For context: I am building a voting library that addresses the issue of polarized American politics by implementing the Virtual Round Robin electoral method with a Maximum Majority Voting algorithm for breaking cycles. The beginnings of the library are available at http://github.com/canadaduane/votelib/blob/master/vote.hs What is a good approach to the parameterized type issue? Thank you, Duane Johnson

On 29 March 2010 13:13, Duane Johnson
How can I parameterize the type of the following data class so that any type can be a Candidate?
data Poll = Poll [Candidate] [Ballot]
data Poll a = Poll [a] [Ballot]
data Poll = Poll [a] [Ballot]
So close... -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

Ah, just a character away. Thank you. Duane On Mar 28, 2010, at 9:21 PM, Ivan Miljenovic wrote:
On 29 March 2010 13:13, Duane Johnson
wrote: How can I parameterize the type of the following data class so that any type can be a Candidate?
data Poll = Poll [Candidate] [Ballot]
data Poll a = Poll [a] [Ballot]
data Poll = Poll [a] [Ballot]
So close...
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
participants (2)
-
Duane Johnson
-
Ivan Miljenovic