data-centric-computing / dcic-public

Repository for (for now) filing bug reports about DCIC.
19 stars 2 forks source link

[DCIC Book]: Mistake in contract of List.member #45

Closed timotree3 closed 1 year ago

timotree3 commented 1 year ago

Contact Details

No response

Which Web page has the problem?

https://dcic-world.org/2022-08-28/tables-to-lists.html

What's the problem?

Thanks for this book! I teach programming, and I really like your approach. There is a mistake in this paragraph

image

The type given is member :: (A -> Boolean), Any -> Boolean, but the function is actually member :: (lst :: List<a>, elt :: a) -> Boolean. If the point is to teach Any, I think you'll have to find a different function as an example.

What browser are you seeing the problem on?

Firefox

shriram commented 1 year ago

Good point, thanks. We'll have to think this through a bit.

[NB: We tend to just let bug reports pile up over the course of the semester, while we're teaching, and then deal with them during break.]

kfisler commented 1 year ago

Actually, Any is the supported type, both in the library of list functions that is in use at this point and in the built-in member function. Looks to me that the Pyret documentation is where the error lies here.

I've fixed the contract in the text to have a list as the first argument and will file a separate issue regarding the type of member in the Pyret docs.