|
|
|
|
|
by dan-robertson
1783 days ago
|
|
Question: 1. Can a GET request have a non-empty request body? 2. Assuming you don’t know the answer to that question, will the type system you use be able to tell you the answer to that question? This is a pretty simple constraint one might want (a constraint that only certain requests have a body) but already a lot of static type systems (e.g. the C type system) cannot express and check it. If you can express that constraint, is it still easy to have a single function to inspect headers on any request? What about changing that constraint in the type system when you reread the spec? Is it easy? The point isn’t that type systems are pointless but that they are different and one should focus on what the type system can do for you, and at what cost. |
|