Skip to content

Date.Time.t -> Date.time #14

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

Merged
merged 1 commit into from
Feb 9, 2023
Merged

Date.Time.t -> Date.time #14

merged 1 commit into from
Feb 9, 2023

Conversation

cknitt
Copy link
Member

@cknitt cknitt commented Feb 9, 2023

The module Time seems overkill.

@cknitt cknitt requested a review from zth February 9, 2023 08:39
@zth zth merged commit 3584fa0 into main Feb 9, 2023
@zth zth deleted the date-time branch February 9, 2023 09:17
module Time = {
type t = float
}
type time = float
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a confusing name for what this actually is. It isn't any more or less a "time" than t, just a different representation. The closest proper name for the format I think is "Unix time".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be explicit, maybe it could be called millisSinceEpoch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that would be better. Since it's no longer a module I don't think it matters much that it's a bit wordy, although ideally I think it also ought to be a private type so that it's distinct from a float, which suggests it should be a module so that it can also have a conventional constructor function. But communicating the concept clearly is more important.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also add more information about what it is exactly in a docstring.

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

Successfully merging this pull request may close these issues.

3 participants