Re: [Haskell-cafe] Idiomatic Haskell equivalent of "keyword arguments"to functions

2006-12-29 Thread Brian Hulley
Paul Moore wrote: I'm thinking around the design of a couple of things, and am hitting an issue which I know how I would solve in Python, but I'm not sure what a good idiomatic Haskell approach would be. The problem is that I am trying to write a function which takes a rather large number of arg

Re: [Haskell-cafe] Idiomatic Haskell equivalent of "keyword arguments" to functions

2006-12-29 Thread Paul Moore
On 12/29/06, Neil Mitchell <[EMAIL PROTECTED]> wrote: Records are your friend. [...] The other alternative is: data EmailParams = Body String | Port Int | Mailserver String Neat ideas. Thanks. I guess there could there be disadvantages

Re: [Haskell-cafe] Idiomatic Haskell equivalent of "keyword arguments" to functions

2006-12-29 Thread David House
On 29/12/06, Paul Moore <[EMAIL PROTECTED]> wrote: I looked at wxHaskell for inspiration - its approach (button f [text := "Quit", on command := close f]) looks quite readable, but slightly unusual (to me) for Haskell. It also seems fairly complex to implement (ie, my head hurt when I tried to fo

Re: [Haskell-cafe] Idiomatic Haskell equivalent of "keyword arguments" to functions

2006-12-29 Thread David House
On 29/12/06, Paul Moore <[EMAIL PROTECTED]> wrote: I looked at wxHaskell for inspiration - its approach (button f [text := "Quit", on command := close f]) looks quite readable, but slightly unusual (to me) for Haskell. It also seems fairly complex to implement (ie, my head hurt when I tried to fo

Re: [Haskell-cafe] Idiomatic Haskell equivalent of "keyword arguments" to functions

2006-12-29 Thread Neil Mitchell
Hi Paul, To make things concrete, the example I'm really thinking of is a "send an email" function, which would take a subject, a body, a list of recipients, optional lists of cc and bcc recipients, an optional mailserver (default localhost), an optional port (default 25), and possibly optional

[Haskell-cafe] Idiomatic Haskell equivalent of "keyword arguments" to functions

2006-12-29 Thread Paul Moore
I'm thinking around the design of a couple of things, and am hitting an issue which I know how I would solve in Python, but I'm not sure what a good idiomatic Haskell approach would be. The problem is that I am trying to write a function which takes a rather large number of arguments, many of whi