[go-nuts] [generics] type list suggestion

2020-06-20 Thread jimmy frasche
I really like how the latest generics draft has progressed, fantastic work. The only thing that doesn't really feel perfect yet is type lists. I like the idea of all constraints being interfaces and I get why interfaces with type lists and/or comparable are only constraints for now. I'd rather the

Re: [go-nuts] [generics] type list suggestion

2020-06-22 Thread Ian Lance Taylor
On Sat, Jun 20, 2020 at 3:51 PM jimmy frasche wrote: > > I really like how the latest generics draft has progressed, fantastic > work. The only thing that doesn't really feel perfect yet is type > lists. > > I like the idea of all constraints being interfaces and I get why > interfaces with type l

Re: [go-nuts] [generics] type list suggestion

2020-06-22 Thread jimmy frasche
Fair enough that I'd missed the last sentence. However, if you mark the types that require exact matches you can't reuse the same sigil in type assertion/switches, so it's unclear how those would work. Plus, it just seems backwards since exact is the default everywhere else. On Mon, Jun 22, 2020

Re: [go-nuts] [generics] type list suggestion

2020-06-22 Thread Ian Lance Taylor
On Mon, Jun 22, 2020 at 3:03 PM jimmy frasche wrote: > > Fair enough that I'd missed the last sentence. > > However, if you mark the types that require exact matches you can't > reuse the same sigil in type assertion/switches, so it's unclear how > those would work. > > Plus, it just seems backwar

Re: [go-nuts] [generics] type list suggestion

2020-06-22 Thread jimmy frasche
> Most people who want sum types don't want the zero value to be nil. I am certainly one of those people, but, if interfaces with type lists can be used for sum types and generics constraints, it's well worth the trade off for keeping the language simple. My major concern with the current notatio