I know but in the case of map, it's a built-in. We have easily higher order functions for that that can be defined.
Where there is a problem is defining higher order functions for generic user-defined containers... I think that it is going a bit too far in the parametrization. It may happen and be somewhat useful, but I don't think that the design should be optimized for it unless pervasive. I leave the Set datastructure out because the implementations may vary too much and I do not have any data points on this. But the question is, are people more likely to use maps of sets or sets of sets...? On Thursday, January 21, 2021 at 1:39:41 AM UTC+1 axel.wa...@googlemail.com wrote: > FTR, the same argument that applies to `List(List(int))` also applies to > `Set(Set(int))` and `Map(Key1, Map(Key2, Val))`, neither of which suffers > from algorithmic complexity issues and both of which I have used in the > past in real code. > > On Thu, Jan 21, 2021 at 1:35 AM atd...@gmail.com <atd...@gmail.com> wrote: > >> Oh, I know it does, as mentioned above. Typically to emulate matrices. >> >> My point was that it is still different from a linked list of linked >> lists.If not time complexity, data locality etc. May be useful for some >> type of very large graph datastructures, I wouldn,'t know since I haven't >> encountered this use case yet. >> If many other people have felt the need for list of lists then I would be >> enlightened. >> >> Also, just pointing out that having higher-order functions easily created >> at compile time for generic code is nice but we also have interfaces which >> could alleviate part of the issue. >> In the end, I am sure you have more data points than I have, my questions >> have been mostly answered, I'll leave the rest in your care. >> >> Cheers, >> >> On Thursday, January 21, 2021 at 1:09:23 AM UTC+1 Ian Lance Taylor wrote: >> >>> On Wed, Jan 20, 2021 at 1:19 PM atd...@gmail.com <atd...@gmail.com> >>> wrote: >>> > >>> > I have been asking because the List of List example seemed a bit >>> contrieved to me. I have seen maps of linked lists or slice of slices for >>> math stuff but rarely lists of lists.(probably because of the time >>> complexity) >>> >>> We will have to disagree on that. A list of lists of int is no more >>> contrived than a type like [][]byte, which is a type that appears at >>> least 50 times in the Go standard library. >>> >>> 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...@googlegroups.com. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/golang-nuts/d51f545b-59af-41dd-bf38-b4a7afe65714n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/golang-nuts/d51f545b-59af-41dd-bf38-b4a7afe65714n%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/f0b9eab5-cbc3-4d4c-a273-65d32bbdb1f2n%40googlegroups.com.