On Mon, Aug 10, 2020 at 7:08 AM Markus Heukelom
<markus.heuke...@gain.pro> wrote:
>
> Just a quick thought, instead of "comparable" (and type lists) maybe we could 
> use a single operator to specify the required "operators" interface:
>
> type BiMap[type V, K ==] struct {
> forward map[K]V
> reverse map[V]K
> }
>
> func Max[type T <](a, b T) T {
>
> }
>
> func ScanRowStruct[type T .](rows sql.Rows, dest *T) error {  // operator . 
> ensures T is a struct
>
> }

It could probably work, but we wind up with a bunch of special purpose
syntax with only a tenuous connection to the way constraints work in
general.  And you have to define connections between operators.  That
is, comparable supports both == and !=, but you only mentioned ==;
does == imply !=?

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXDuwR87UBpPCXsViqN5grg8hB3y_YRbEpBsz-uYJ0%2BRg%40mail.gmail.com.

Reply via email to