Subject: RE: Generics...

MR K P SCHUPKE k.schupke at imperial.ac.uk
Mon Feb 9 12:47:27 EST 2004


> the identity function will convert one to the other

Okay. This I understand.

I understand why the type of a generic transform has to be:

gtrans :: Data a => a -> a

and thinking about this has given me the solution. Obviously 
my data types are wrong... If a loose one type and create an
angebraic type instead along the lines of:

data SqlType a = TypedExpr String | SqlColumn String

Then I can express the function I want generically. 
Where this leads to messy nested constructors, I can use
constructor functions to neaten things up again.

So... I need to think about the generic transforms I wish
to implement before specifying the data types.         

This will probably lead to a better use of the types anyway.

	Regards,
	Keean Schupke.


More information about the Glasgow-haskell-users mailing list