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

The prelude function width is misleadingly named #550

Closed
brianhuffman opened this issue Oct 10, 2018 · 0 comments
Closed

The prelude function width is misleadingly named #550

brianhuffman opened this issue Oct 10, 2018 · 0 comments

Comments

@brianhuffman
Copy link
Contributor

The name width leads users to believe (incorrectly) that the function's behavior agrees with the type-level operator of the same name. (See #549.) We should rename the value-level function to length, to match the standard list length function in common languages like Haskell, ML, etc.

Also, we need to provide a docstring for this function; currently it has none. This leads to a very confusing situation where it appears that the docstring for the type-level width applies to the value-level function as well:

Cryptol> :? width

    width : {bits, n, a} (fin n, fin bits, bits >= width n) =>
              [n]a -> [bits]

    primitive type width : # -> #

The number of bits required to represent the value of a numeric type.
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

1 participant