Re: [go-nuts] Re: Type parameters syntax... Can it be improved?

2021-03-24 Thread at diar
Yes, and... (just in case someone else comes across this thread wondering in the distant future) , func(v T) T is not too big a problem but func(v T) R If the function body has cases, i.e. flow sensitive, that's where the brackets are mandatory to make the inference more straightforwardly

[go-nuts] Re: Type parameters syntax... Can it be improved?

2021-03-24 Thread Markus Heukelom
I agree here that there is a lot of repetition in the function definitions of let's say a generic math package: types Numbers { type float32,float64, } func Abs[T Floats](a T) T {} func Sin[T Floats](a T) T {} func Cos[T Floats](a T) T {} etc. (50 orso more?) It feels a bit redundant and