2007/1/11, Marco Túlio Gontijo e Silva <[EMAIL PROTECTED]>:
Hello,
is there a way to defined something as a map to use in tuples? I tried
this:
mapTuple f (a, b) = (f a, f b)
But the type inferred to it is not as generic as I wanted:
mapTuple :: (t -> t1) -> (t, t) -> (t1, t1)
Then I tried a different, but not much, implementation:
mapTuple' f g (a, b) = (f a, g b)
mapTuple f = mapTuple' f f
But the inferred type was the same.
Is there a way to define a function in which I can be able to do
something as this?
mapTuple show ("string", True)
Hi,
you might want invistigate "heterogeneous lists" : in your case, it's
"heterogeneous typle".
There's a page lying on the wiki I think... It involves typeclasses
and type quantifiers.
Ciao,
minh thu
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe