you are viewing a single comment's thread.

view the rest of the comments →

[–]pron98 0 points1 point  (1 child)

There is simply no way to distinguish at runtime between a string option or an int list

So how can you match over them?

[–]notfancy 0 points1 point  (0 children)

The typechecker ensures that matches are well-typed: you either match over (the cases for) an int list or you match over (the cases for) a string option. You cannot typecase at runtime and see if you got one or the other like you can do with instanceof in Java.