Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text description of "null" in Chapter 6 is reversed #121

Open
mgritter opened this issue Nov 30, 2022 · 1 comment
Open

Text description of "null" in Chapter 6 is reversed #121

mgritter opened this issue Nov 30, 2022 · 1 comment

Comments

@mgritter
Copy link

The "safe head" exercise asks us to write a specification for null:

<div class="hwex" id="Safe Head">
Write down a specification for `null` such that `safeHead`
is verified. Do *not* force `null` to only take non-empty inputs,
that defeats the purpose. Instead, its type should say that it
works on *all* lists and returns `True` *if and only if* the input
is non-empty.
</div>

null []       =  True
null (_:_)    =  False

The implementation of null returns true if and only if the input is empty, consistent with its name. So I believe the last word in the text is a mistake?

@ranjitjhala
Copy link
Member

Oops, good catch!!! Let me fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants