Re: [go-nuts] [generics] is generics with constrain needed ?

2020-06-23 Thread teeling . sean
Instead of doing the implicit conversion to the interface, why not relax the constraint and allow anything that implements the interface? On Wednesday, June 17, 2020 at 1:37:35 AM UTC-7, David Anderson wrote: > > The non-generic form _only_ accepts an argument of type []Stringer. If you > have a

[go-nuts] [Generics] Concise generics with package level types

2020-06-23 Thread teeling . sean
Imagine the following function definition, under the current proposal (I believe this is correct): func (s MyMap(K, V)) DoSomething(k K, v V) (func(type K Hashable) (k K) (V, error)) {...} At least for me, the above takes a while for me to grok. In my opinion the current proposed syntax gets