Skip to content

Derive generic #31

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

Closed
wants to merge 4 commits into from
Closed

Derive generic #31

wants to merge 4 commits into from

Conversation

FrigoEU
Copy link

@FrigoEU FrigoEU commented May 5, 2016

Continuation of #22. All I added was generic deriving for the rest of the types in src/Date. I added some question in #22, so I guess I'll add them here as well to maybe keep the discussion going.

What offset/timezone support do you think would be most beneficial? Is it the plan here to incorporate this whole body of (notoriously tricky) offset/timezone logic like a library like moment.js does?

Would it be a possibility to merge this PR as it is now and hold off on the move to a newtype around Milliseconds + timezone/offset? Or do you think that's a bad idea?

@garyb
Copy link
Member

garyb commented May 5, 2016

I'd prefer not to merge this as Date cannot have a "proper" Generic instance defined as it can't be accurately represented with the Generic types (#22 and #27 had discussion about this). I am working on that new version of the library that avoids JSDate entirely, so at that point it will be possible to be Generic.

As for the timezone offset logic, I don't think it will be all that tricky: there will be a canonical date form that is based on UTC, and then another "local time" type that adds the offset on top of it. It will probably not be possible to perform many operations on the local time type, instead it will require conversion to/from the UTC type.

@FrigoEU
Copy link
Author

FrigoEU commented May 5, 2016

Oh, I misunderstood and thought you would be ok with merging this. Apologies!

New version sounds interesting. If there's anything I can do to help out, let me know.

@garyb
Copy link
Member

garyb commented Jun 9, 2016

The new stuff also has Generic everything 🎉

@garyb garyb closed this Jun 9, 2016
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