by taude · 7y ago · 0 comments
Is there any recent writings on this pattern on applying the idea more sanely? As it is, I think I prefer to write testing code outside of the core behavior and have to anticipate what values are valid, or create new tests as bugs are found.
Also, there’s been a lot of work in the Racket community on contracts: I think it has something to do with making Racket/Typed Racket interop safe .
One concern I have with their Erlang solution is that the preconditions and postconditions are expressed for the function as a whole, not each function clause. In some contexts, rather like OOP, a function can be quite different depending on the context it’s called with.