News for hackers. Stuff that matters.
Re:Why it’s hard for programmers to write a program to flatt... by dragonwriter on Friday February 24, 2017 @02:39PM (#13726985)
Yes, but Java (unless I missed a recent change) doesn't let you assign new interfaces to existing types, so short of either wrapping Lists and Ints in containers implementing a common interface and demanding that the input be in the wrapped form, that doesn't actually help.
Re:Why it’s hard for programmers to write a program to flatt... by dllthomas on Friday February 24, 2017 @02:48PM (#13727090)
Faced with this problem, I would precisely wrap Lists and Ints in containers implementing a common interface and demand that the input be in that form (actually, the input is text right? so I'd parse it into that form - assuming I couldn't get away with just manipulating the textual representation).

Note that in the genuine sum-type case you're wrapping, too.