In using Derive to generate Haskell code, I have run into two Gotcha's
that I am not sure need to be there:

1. "multiply defined"
I get this error message if I attempt to do
> sqlType "Int" = "Integer"
> h=2 -- removing this line makes this code work
> sqlType "String" = "VarChar(255)"

This restriction is very frustrating because I want to add names to a
function lookup table as they are derived.   Is there a strong reason for
disallowing this syntax?  The type checker prevents the definition of
multiple functions with the same name and different type and the does not
prevent:

> foo 1 = 2
> foo 1 = 3

It also allows:

> sqlTypeInt = "Integer"
> h=2
> sqlTypeString = "VarChar(255)"

Ideally you could define different cases for sqlType in different
modules, but I realize that is probably much harder to implement.

2. local import
A module only needs to import a class definition if a type in the module 
derives that class.  It would be nice to have locally scoped import so
that the user does not both have to add derive statements and have to add
import statements (and deal with name space conflicts)

-Alex-


___________________________________________________________________
S. Alexander Jacobson                   i2x Media  
1-212-697-0184 voice                    1-212-697-1427 fax



Reply via email to