The HtDF Recipe


1. Signature, purpose, and stub

<aside> 💡 Every step of the recipe will support subsequent steps.

In the examples above, the signature helps us write both the purpose and the stub. Number -> Number tells us that the function double takes in 1 number and produces another number — a detail which is important when describing the function’s purpose.

It also tells us that double only takes in 1 parameter (a Number). This aspect of the signature indicates that we should be only include 1 parameter in the function stub.

Lastly, the signature is also important for examples contained in check-expect structures — it helps to ensure that the I/O data types are accurately reflected in the example.

</aside>