Contracts tell us how to use a function, by telling us three important things:
- The Name
- The Domain of the function - what kinds of inputs do we need to give the function, and how many?
- The Range of the function - what kind of output will the function give us back?
For example: The contract triangle :: (Number, String, String) -> Image tells us that the name of the function is triangle, it needs three inputs (a Number and two Strings), and it produces an Image.
With these three pieces of information, we know that typing will evaluate to an Image.
Searching for a function?
Name | Domain | Range |
---|