Chris Angelico <ros...@gmail.com> writes: > So since you can set something to Nothing regardless of type, and > compare it against Nothing regardless of type, it doesn't really much > matter that there are different types of Nothing. Right?
No that's not how type inference works. If you have x = Nothing and pass it to a function that takes a Maybe Int, type inference means the compiler figures out that x must have type Maybe Int. If you then also pass x to something that takes Maybe String, you are telling the compiler that x has two different types at the same time, so the compiler reports a type error. -- https://mail.python.org/mailman/listinfo/python-list