3 ms·
To be clear, this is what ML's variant types are all about. You can easily create a list that contains e.g. both ints and chars: let mylist = [`Int 5; `Char
by rkts 19y ago
To be clear, this is what ML's variant types are all about. You can easily create a list that contains e.g. both ints and chars:
let mylist = [`Int 5; `Char '5']
Technically the elements have the same compile-time type, but the question is, what practical difference does that make? In what cases are variants an inadequate solution?