4 ms·
Haskell: (1, "abc", 4.0)
by GregBuchholz 12y ago
Haskell:
(1, "abc", 4.0)
- kazinator 12y agoAre you sure that is a list, and not something else, like a tuple?
- dllthomas 12y agoIt's precisely a tuple, obviously. Are you sure you said "list", not "heterogeneous collection"? If you know what is where in the list, then you semantically have a tuple. If you don't know what is where in the list, then you need some way of telling things apart. At which point an ADT is frequently the right solution, isn't any sort of advanced technique, and requires very little in the way of boilerplate.