Generics...

MR K P SCHUPKE k.schupke at imperial.ac.uk
Thu Feb 5 16:01:08 EST 2004


> Presumably not "replace all Ints by Floats"

I've thought about it some more, and I don't think its
possible to do what I want using generics... Ideally I would like
to achieve the following type transformation:

type SqlColumn a = String
type TypedExpr a = Int

the function would map SqlColumns to TypedExpr... The actual code
generates an integer from a sequence to "tag" each column, but for
the sake of simplicity, the following types would be sufficient:

type SqlColumn a = String
type TypedExpr a = String

So we take a tuple of any length and return exactly the same
tuple, but with the types changed:

project :: (SqlColumn a,SqlColumn b) -> (TypedExpr a,TypedExpr b)

project :: (SqlColumn a,SqlColumn b,SqlColumn c) -> (TypedExpr a,TypedExpr b,TypedExpr c)


What do you think?

	Regards,
	Keean Schupke.


More information about the Glasgow-haskell-users mailing list