Skip to content

Add sinceEpoch and asSeconds #83

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 2 commits into from
Nov 19, 2023

Conversation

Kleidukos
Copy link
Collaborator

@chessai I've taken the liberty of filling in the next release's changelog. Please tell me if the numbers are not correct.

@Kleidukos Kleidukos force-pushed the add-since-epoch-and-as-seconds branch from 56b41d6 to c7b87ca Compare November 17, 2023 22:24
@andrewthad
Copy link
Member

I think that sinceEpoch makes sense and is a good addition. However, asSeconds creates a Timespan with the wrong implied unit. The unit for a Timespan is always supposed to be nanoseconds. If it isn't, then when you add a Timespan to a Time (via the Torsor Time Timespan instance), the result is meaningless. It would make more sense to have:

asSeconds :: Timespan -> Int64

@Kleidukos
Copy link
Collaborator Author

@andrewthad Perfect, thank you!

@andrewthad andrewthad merged commit 04a6816 into byteverse:master Nov 19, 2023
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.

2 participants