1.3 KiB
1.3 KiB
Hints
General
- Remember to reference the table in the instructions.
1. Given an extension, return the expected media type
- Use pattern matching to return the correct media type.
- You can use multiple function clauses.
2. Given a binary file, return the expected media type
- Use the binary special form available to you for writing a binary literal.
- Use pattern matching to match against the first few bytes of the file binary.
3. Given an extension and a binary file, verify that the file matches the expected type
- Reuse the functions you created for parts 1 and 2.
- Compare the return value of each function, then return the appropriate value.
- You can use the
if
macro conditional for binary conditions.
- You can use the