[Haskell-cafe] Is there anyone out there who can translate C# generics into Haskell?

Nicholls, Mark Nicholls.Mark at mtvne.com
Thu Jan 3 04:55:23 EST 2008


I was thinking more along type classes....and then I was going to throw
some spanners in the works....

 

________________________________

From: Ryan Ingram [mailto:ryani.spam at gmail.com] 
Sent: 02 January 2008 17:41
To: Nicholls, Mark
Cc: haskell-cafe at haskell.org
Subject: Re: [Haskell-cafe] Is there anyone out there who can translate
C# generics into Haskell?

 

Of course it depends what's inside the braces, and what you want to do
with it, but I'd be inclined to do something like this:

 

1) data IX a = IX { constructor :: Int -> a, ... }

2) data IX a b = IX { constructor :: Int -> b, func :: a -> b, ... }

3) data IX a b = IX { iy :: IY a, ... }

4) data IX a b = IX { iz :: IZ b, iy :: IY a, ... }

 

Can you specify more clearly what the goal of the conversion is?  If you
want "OO" style behavior the thing that is most important is existential
quantification.

 

  -- ryan

 

On 1/2/08, Nicholls, Mark <Nicholls.Mark at mtvne.com> wrote: 

I'm trying to translate some standard C# constucts into Haskell... some
of this seems easy....

Specifically

1)

Interface IX
{
}

2)

Interface IX<A>
{
}

3)

Interface IX<A>
       Where A : IY
{
}

4)

Interface IX<A> : IZ
       Where A : IY
{
}


I can take a punt at the first 2....but then it all falls apart
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080103/09a59005/attachment.htm


More information about the Haskell-Cafe mailing list