<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>fromInteger for Lists</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>There's nothing better than making a data type an instance of Num. In particular, fromInteger is a joy. But how about lists?<BR>
<BR>
For example, if I have<BR>
<BR>
data Foo a = F [a]<BR>
<BR>
I can create a fromInteger such as<BR>
fromInteger i = F [fromInteger i]<BR>
<BR>
and then a 19::(Foo Int), could become F [19].<BR>
<BR>
Is it possible to do something similar for lists? So could<BR>
[1,2,3]::(Foo Int) become something slightly different, say,<BR>
<BR>
F [1,2,3]<BR>
<BR>
Paul</FONT>
</P>

</BODY>
</HTML>