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

2008-01-03 Thread Ketil Malde
"Peter Verswyvelen" <[EMAIL PROTECTED]> writes: > Well, it's a good habit in Haskell to move the "most important" parameter to > the end of the argument list. See e.g. > http://www.haskell.org/haskellwiki/Parameter_order. I must say I like these recommendations. As for the Data.Map examples, th

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

2008-01-03 Thread Nicholls, Mark
Ahh ok I see what is meant by the parameter order -Original Message- From: Peter Verswyvelen [mailto:[EMAIL PROTECTED] On Behalf Of Peter Verswyvelen Sent: 03 January 2008 12:02 To: Nicholls, Mark Cc: haskell-cafe@haskell.org Subject: RE: [Haskell-cafe] Is there anyone out there who

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

2008-01-03 Thread Peter Verswyvelen
Hi Mark, >> "foo1 :: Int -> obj -> String" > Yep...I think that's what I'd dothough I would have done... > "foo1 :: obj -> Int -> String" > Does that matter? Well, it's a good habit in Haskell to move the "most important" parameter to the end of the argument list. See e.g. http://www.haskell.

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

2008-01-03 Thread Nicholls, Mark
29 To: Nicholls, Mark Cc: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] Is there anyone out there who can translate C# generics into Haskell? Hello Mark, Wednesday, January 2, 2008, 7:40:31 PM, you wrote: > I'm trying to translate some standard C# constucts into Haskell... some it's

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

2008-01-03 Thread Nicholls, Mark
[snip] >-- C#: interface IX1 { String foo1(int); } >class IX1 obj where > foo1 :: Int -> obj -> String Yep...I think that's what I'd dothough I would have done... "foo1 :: obj -> Int -> String" Does that matter? >-- C#: interface IX2 { String foo2(A); } >class IX2 obj a where > foo2

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

2008-01-03 Thread Nicholls, Mark
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 :: I

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

2008-01-02 Thread Bulat Ziganshin
Hello Mark, Wednesday, January 2, 2008, 7:40:31 PM, you wrote: > I'm trying to translate some standard C# constucts into Haskell... some it's meaningless. read http://haskell.org/haskellwiki/OOP_vs_type_classes and especially papers mentioned in the References -- Best regards, Bulat

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

2008-01-02 Thread Ryan Ingram
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