instance Ord ZonedTime

Open
#49 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
haskell
Domain
backend

Research direction

Start by inspecting the existing Generic-derived Ord instance for ZonedTime and the definitions of zonedTimeToUTC and zonedTimeZone. Compare the current ordering with the proposed UTC-based ordering, then verify that the resulting behavior matches the intended chronological semantics.

Written by the indexing model from the issue text.

Description

Currently uses the Generic Deriving

Would it make more sense or have the Ord instance

instance Ord ZonedTime where
    compare a b = compare (f a) (f b)
        where f t = (zonedTimeToUTC t, zonedTimeZone t)

so that ZonedTime is sorted by when the utc time rather than when it happens within the local timezone?

Dominant language
Haskell
Stars
47
Forks
35
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from haskell-github-trust/thyme

All issues in haskell-github-trust/thyme

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.