
9 Feb
2004
9 Feb
'04
7:47 a.m.
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.