5 ms·
Maybe the computer can infer the types after you've written a correct program, but if you write down the types up front before you start the implementation, the
by Smaug123 6y ago
Maybe the computer can infer the types after you've written a correct program, but if you write down the types up front before you start the implementation, the computer will hold your hand while you implement.
It sounds like you haven't used something Hindley-Milner based - I'd recommend giving it a go, so that you can feel what it's like. Much as Typescript gives you incremental typing over JS, so too does type inference give you incremental static specification of the types over the fully inferred program. When you don't need to write down the types, the inference engine gets out of your way; when you want to use the types to constrain the possible programs you could be writing, the inference engine puts up the guardrails to stop you making mistakes.
- DenisM 6y ago> if you write down the types up front before you start the implementation, the computer will hold your hand while you implement. This is exactly it. Thank you.