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

Durations form a vector space #127

Open
treeowl opened this issue Mar 23, 2022 · 1 comment
Open

Durations form a vector space #127

treeowl opened this issue Mar 23, 2022 · 1 comment

Comments

@treeowl
Copy link
Contributor

treeowl commented Mar 23, 2022

If we admit negative durations (e.g., X happened -1 seconds after Y = X happened 1 second before y), then durations form a vector space. I don't know enough about vector space classes available on Hackage, but we could instantiate them ... if we admitted negative Time. I don't understand why it's not allowed.

@dcastro
Copy link
Member

dcastro commented Mar 26, 2022

I'm not familiar with vector spaces, but I too have previously wondered why negative durations are not allowed, and the initial rationale has not been documented anywhere (AFAIK).

To give a concrete use case, this would be useful to calculate the period between two events t0 and t1 where you don't know which event will happen first (i.e. t1 - t0 could be positive or negative).

Also, another related issue: #118

However, doing this at this stage would be a significant breaking change. @gromakovsky what do you think about this?

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