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

Ryan Ingram ryani.spam at gmail.com
Wed Jan 2 12:40:53 EST 2008


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/20080102/f4a0d716/attachment.htm


More information about the Haskell-Cafe mailing list