After being so impressed by the power of Haskell's inference,
many people next discover that they can't put values of
different types into lists.¹ Well, that's not quite true, you
can always chain 2-tuples together, but that's not what you
really mean. Well, what did you mean? Oh, well, I meant that
sometimes the elements of my list are integers, and sometimes
they're strings. Okay, no problem. Put the integer type and
string type together as alternatives in a single type: data
IntOrString = AnInt Int | AString String [AnInt 42, AString
"hi"] -- has type [IntOrString]No, I meant that it's alternating
integers and strings, one of each for the other. Well why didn't
you say so! data IntAndString = IntAndString Int String
[IntAndString 42 "hi"] -- has type [IntAndString]You can't just
stick integers and strings together in a list without proving
something about what you mean. To write any program typefully,
you have to prove that it sort of makes sense. In the former
example, you really meant that each element c