4 ms·
If you're talking about the fact that you have to unbox the Maybe, that's not really related to type inference or static types but how "null" values are represe
by PhineasRex 7y ago
If you're talking about the fact that you have to unbox the Maybe, that's not really related to type inference or static types but how "null" values are represented in the language.
If you're talking about exhaustiveness checks, you can disable those and use `-fdefer-type-errors` to compile programs which don't type-check.
Although I will say that most of the time when you have a Maybe instance that you know is Just, it means you're branching in the wrong part of your program.
- pron 7y ago> If you're talking about exhaustiveness checks, you can disable those and use `-fdefer-type-errors` to compile programs which don't type-check. Right, but if you were using, say, Idris, the program would type check. It's just that Haskell's type system is too weak. Disabling type checking is not what the question was about. The program is type-correct, yet not in Haskell's particular system. > Although I will say that most of the time when you have a Maybe instance that you know is Just, it means you're branching in the wrong part of your program. Perhaps, but that doesn't change the fact that if you write it in some way that is perfectly correct, Haskell's particular type system will still not accept your program.