{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreightbk2ajl5x6fpq7oxhd2rz5qrkhbbbdacgnmceyadyzudtymkhi",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mj5zcuzdzq72"
},
"path": "/t/would-keyword-arguments-conflict-with-currying-in-haskell/13906#post_8",
"publishedAt": "2026-04-10T18:50:53.000Z",
"site": "https://discourse.haskell.org",
"textContent": "Shantanu-sg-01:\n\n> Would adding keyword arguments conflict with currying in Haskell?\n>\n> For example, how would partial application work if arguments could be passed out of order or by name?\n\nI don’t think it would necessarily conflict with currying. I imagine it could work as a bit of syntactic sugar, e.g.\n\n\n httpRequest :: String -> Method -> Maybe Body -> IO Response\n httpRequest url method body = ...\n\n -- Partially apply the function with a keyword argument\n httpRequest method:POST\n\n -- ... which would desugar to\n \\url body -> httpRequest url POST body\n\n\nSomething like the above could still be curried as usual:\n\n\n mapM (httpRequest body:Nothing method:GET)\n [ \"https://example.com\",\n \"https://google.com\",\n ...\n ]\n\n\nThat said, this only works if all keyword arguments are mandatory. _Optional_ keyword arguments would be more complicated since it would be ambiguous whether we intend to call with defaults or want to wait for the rest of the arguments. This could potentially be disambiguated based on where/how the function is used or explicitly via some extra syntax.",
"title": "Would keyword arguments conflict with currying in Haskell?"
}