4 ms·
> I can impose constraints on my callers so that they can't accidentally call my code wrong, all the better. This is precisely the mentality that impedes produ
by wellpast 7y ago
> I can impose constraints on my callers so that they can't accidentally call my code wrong, all the better.
This is precisely the mentality that impedes productivity in typical business delivery case. If your callers are not thinking in terms of contracts (precondition/postcondition) then you've hired the wrong "callers"; some amount of type checking may save you in some cases but your function contracts go far, far beyond the type signature - and here, with callers you can't trust, you're screwed anyway and types won't save you (and it sounds like they've given you a false sense of security.)
Better to build a process and expertise that increases correctness for the entire function contract not just the narrow bit that can be expressed in a type.
- whateveracct 7y agoHaskell function contracts don't tend to go that far beyond a type signature. Partially because what can be expressed in the type isn't that narrow nowadays. The situation you're describing is a gigantic strawman per my years of professional FP experience.