Generics...
Simon Peyton-Jones
simonpj at microsoft.com
Thu Feb 5 09:24:51 EST 2004
I'm not sure what you want to do. Presumably not
"replace all Ints by Floats"
because that wouldn't make sense if you applied it to the type
data T = MkT Int T | Nil
So, can you say precisely what you want your generic function to do?
What type would you like it to have?
Simon
| -----Original Message-----
| From: glasgow-haskell-users-bounces at haskell.org
[mailto:glasgow-haskell-users-
| bounces at haskell.org] On Behalf Of MR K P SCHUPKE
| Sent: 04 February 2004 18:43
| To: glasgow-haskell-users at haskell.org
| Subject: Re: Generics...
|
|
| I now have a vague clue how to do what I wanted. I wanted to
substitute
| types in place... a silly example would be to convert Ints to Floats
and
| Floats to Ints...
|
| (3 :: Int, 4.0 :: Float) -> (3.0 :: Float, 4 :: Int)
|
| I already have a function that will convert the input to:
|
| [("3",IntType),("4.0",FloatType)]
|
| So I can then manipulate the list in this form to:
|
| [("3.0",FloatType),("4",IntType)]
|
| All I now need to do is reconstruct back into the data structure...
|
| I have however been unable to find any docs on "gunfold" which I
| think is the way to do this...
|
| If somebody point me to some documentation for gunfold, or
| help in any way I would be very grateful...
|
| Regards,
| Keean Schupke.
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
More information about the Glasgow-haskell-users
mailing list