I knew there must be a way in GHC to do that second example!
As for the third example, it might be a slick way to do some
super-hyper-refactoring, but I admit I can't think of anything it
would be actually necessary for offhand.
--Grady
On 1/12/07, Cale Gibbard <[EMAIL PROTECTED]> wrote:
On 12
On 12/01/07, Grady Lemoine <[EMAIL PROTECTED]> wrote:
Is there anything in particular you're trying to accomplish? It seems
like this is the type of thing you'd accomplish with typeclasses if
you had a less general problem than you've presented. For example,
> mapShowTuple :: (Show a, Show b)
Is there anything in particular you're trying to accomplish? It seems
like this is the type of thing you'd accomplish with typeclasses if
you had a less general problem than you've presented. For example,
mapShowTuple :: (Show a, Show b) => (a, b) -> (String, String)
mapShowTuple (x, y) = (sho
Marco Tu'lio Gontijo e Silva wrote:
> is there a way to defined something as a map to use in tuples?
Yes, it is: and it is quite easy and straightforward.
Udo Stenzel
> since c would be a variable that ranges over type classes, and that
> doesn't exist.
Of course it does: please see below (as w
Udo Stenzel wrote:
> Marco T?lio Gontijo e Silva wrote:
> > 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, t
Marco Túlio Gontijo e Silva wrote:
> 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)
What you seem to want to do is im
Em Qui, 2007-01-11 às 16:51 +0100, minh thu escreveu:
> 2007/1/11, Marco Túlio Gontijo e Silva <[EMAIL PROTECTED]>:
> > Em Qui, 2007-01-11 às 16:14 +0100, minh thu escreveu:
> > > you might want invistigate "heterogeneous lists" : in your case, it's
> > > "heterogeneous typle".
> >
> > But aren't
On 11/01/07, Marco Túlio Gontijo e Silva <[EMAIL PROTECTED]> wrote:
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)
Let's think a
On 11-jan-2007, at 16:30, Marco Túlio Gontijo e Silva wrote:
Em Qui, 2007-01-11 às 16:14 +0100, minh thu escreveu:
you might want invistigate "heterogeneous lists" : in your case, it's
"heterogeneous typle".
But aren't tuples always heterogeneous?
Yes, and precisely therein lies the proble
2007/1/11, Marco Túlio Gontijo e Silva <[EMAIL PROTECTED]>:
Em Qui, 2007-01-11 às 16:14 +0100, minh thu escreveu:
> you might want invistigate "heterogeneous lists" : in your case, it's
> "heterogeneous typle".
But aren't tuples always heterogeneous?
You're right but the fact you apply a funct
Em Qui, 2007-01-11 às 16:14 +0100, minh thu escreveu:
> you might want invistigate "heterogeneous lists" : in your case, it's
> "heterogeneous typle".
But aren't tuples always heterogeneous?
Regards.
--
malebria
Marco Túlio Gontijo e Silva
Correio (MSN): [EMAIL PROTECTED]
Jabber (GTalk): [EMAIL
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
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
13 matches
Mail list logo