On Tue, Aug 18, 2020 at 9:04 PM Frederik Zipp <frederik.z...@gmail.com>
wrote:

> I'd argue that every type expresses a certain subset of types, not just
> interfaces. For the other types the size of the subset just happens to be 1
> (each containing just itself).
>

You can certainly argue that. Though FTR, conceptually that's a very tricky
idea - sets containing themselves lead to all kinds of contradictions.

In either case - you can view it however you prefer, of course. But simply
stating that doesn't convince other people to adopt that view.

Type lists are still a new concept. Just because they hide inside
> interfaces doesn't mean that they are not a new concept.
>

As I argued in the thread I linked above: I think just as you can argue
that constraints and interfaces are different enough to make it confusing
to unify them, you can argue that they are similar enough to make it
confusing to separate them out.

I think neither view is inherently better. Both work just fine and have
very similar up- and downsides.

On the go2go.dev branch they recently made a change to use the actual (not
> underlying) types of type list elements for interface satisfaction:
> https://github.com/golang/go/commit/af48c2e84b52f99d30e4787b1b8d527b5cd2ab64
>
>

I wasn't aware of that change, thank you. AIUI, what I said remains true
though - `interface { type int }` constrains the type-argument to have
underlying type `int`. It's just that now, `interface { type time.Duration
}` no longer allows types with underlying type `int64`, for example.

> --
> 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/96914146-3f4e-4972-a18a-3d6b957acb90n%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/96914146-3f4e-4972-a18a-3d6b957acb90n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAEkBMfHopmybxwTAhJxCBebMah2kgMNHrz%3DCME_NUjAKcV%3DKPQ%40mail.gmail.com.

Reply via email to