3 ms·
Is the question not just one of defining the sets of "things" that are being accepted here? It's not that the compiler shouldn't care, but that you have defined
by tlavoie 4y ago
Is the question not just one of defining the sets of "things" that are being accepted here? It's not that the compiler shouldn't care, but that you have defined an appropriate data structure and set of acceptable types that you would nicely pattern-match on when using them later.
To @kazinator's point, it's not quite going to be just lists of random things, in that Haskell's list elements are all the same type, unlike what Common Lisp lets you do. I'd be more curious whether this could be lists of "Thing", where that Thing type is a typeclass that is inclusive of all the sorts of data you would expect to handle.