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

Improve support for OverloadedRecordDot #2

Merged
merged 2 commits into from
Sep 25, 2023
Merged

Conversation

dcastro
Copy link
Member

@dcastro dcastro commented Sep 25, 2023

Description

Problem: The Data.Time.TZTime module does not export its fields; instead, it exports 3 functions for reading those fields: tzTimeLocalTime, tzTimeTZInfo, tzTimeOffset.

We want them to behave as field-like as possible, but read-only.

However, they cannot be used with OverloadedRecordDot, i.e. you cannot write something like tz.tzTimeLocalTime.

Solution: Add HasField instances.

Related issue(s)

None

✅ Checklist for your Pull Request

Related changes (conditional)

  • Tests

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from
      silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:

Stylistic guide (mandatory)

Problem: The `Data.Time.TZTime` module does not export its fields;
instead, it exports 3 functions for reading those fields:
`tzTimeLocalTime`, `tzTimeTZInfo`, `tzTimeOffset`.

We want them to behave as field-like as possible, but read-only.

However, they cannot be used with `OverloadedRecordDot`, i.e. you cannot
write something like `tz.tzTimeLocalTime`.

Solution: Add `HasField` instances.
@dcastro dcastro merged commit e6c7a1b into main Sep 25, 2023
26 checks passed
@delete-merged-branch delete-merged-branch bot deleted the diogo/OverloadedRecordDot branch September 25, 2023 15:39
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.

None yet

1 participant