Re: [rust-dev] Using Default Type Parameters
On 02/03/2014 12:41 PM, Gábor Lehel wrote: Possibly, but it's not particularly well-trodden ground (I think Ur/Web might have something like it?). And would you really want to write `HashMap`? Naturally it would be optional subject to some rules. I think this has nice parallels with the yet non-existent keyword/default function arguments. -SL ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev
Re: [rust-dev] Using Default Type Parameters
Possibly, but it's not particularly well-trodden ground (I think Ur/Web might have something like it?). And would you really want to write `HashMap`? On Mon, Feb 3, 2014 at 6:34 PM, Matthieu Monrocq wrote: > > > > On Mon, Feb 3, 2014 at 8:41 AM, Gábor Lehel wrote: > >> On Mon, Feb 3, 2014 at 7:55 AM, Corey Richardson wrote: >> >>> Default typarams are awesome, but they're gated, and there's some >>> concern that they'll interact unpleasantly with extensions to the type >>> system (most specifically, I've seen concern raised around HKT, where >>> there is conflicting tension about whether to put the "defaults" at >>> the start or end of the typaram list). >>> >> >> Just for reference, this was discussed here: >> https://github.com/mozilla/rust/pull/11217 >> >> (The tension is essentially that with default type args you want to put >> the "least important" types at the end, so they can be defaulted, while >> with HKT you want to put them at the front, so they don't get in the way of >> abstracting over the important ones.) >> >> > Thinking out loud: could parameters be "keyed", like named functions > arguments ? If they were, then their position would matter little. > > -- Matthieu > > >> ___ >> Rust-dev mailing list >> Rust-dev@mozilla.org >> https://mail.mozilla.org/listinfo/rust-dev >> >> > ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev
Re: [rust-dev] Using Default Type Parameters
On Mon, Feb 3, 2014 at 8:41 AM, Gábor Lehel wrote: > On Mon, Feb 3, 2014 at 7:55 AM, Corey Richardson wrote: > >> Default typarams are awesome, but they're gated, and there's some >> concern that they'll interact unpleasantly with extensions to the type >> system (most specifically, I've seen concern raised around HKT, where >> there is conflicting tension about whether to put the "defaults" at >> the start or end of the typaram list). >> > > Just for reference, this was discussed here: > https://github.com/mozilla/rust/pull/11217 > > (The tension is essentially that with default type args you want to put > the "least important" types at the end, so they can be defaulted, while > with HKT you want to put them at the front, so they don't get in the way of > abstracting over the important ones.) > > Thinking out loud: could parameters be "keyed", like named functions arguments ? If they were, then their position would matter little. -- Matthieu > ___ > Rust-dev mailing list > Rust-dev@mozilla.org > https://mail.mozilla.org/listinfo/rust-dev > > ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev
Re: [rust-dev] Using Default Type Parameters
On Mon, Feb 3, 2014 at 7:55 AM, Corey Richardson wrote: > Default typarams are awesome, but they're gated, and there's some > concern that they'll interact unpleasantly with extensions to the type > system (most specifically, I've seen concern raised around HKT, where > there is conflicting tension about whether to put the "defaults" at > the start or end of the typaram list). > Just for reference, this was discussed here: https://github.com/mozilla/rust/pull/11217 (The tension is essentially that with default type args you want to put the "least important" types at the end, so they can be defaulted, while with HKT you want to put them at the front, so they don't get in the way of abstracting over the important ones.) ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev
[rust-dev] Using Default Type Parameters
Default typarams are awesome, but they're gated, and there's some concern that they'll interact unpleasantly with extensions to the type system (most specifically, I've seen concern raised around HKT, where there is conflicting tension about whether to put the "defaults" at the start or end of the typaram list). I've already come across situations where default typarams will make for a nicer API, but I'm wondering whether I should use them without hesitation, looking forward to when they are no longer gated, or whether I should shun them because they will make my code incompatible with future changes to the language. Is there any thoughts on this so far? This question also applies to other feature gatess; the level of assurance one can use a given feature with without having to deal with explosive breakage down the line. ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev