Skip to content

Update clock dependency#2

Open
Helkafen wants to merge 2 commits intolpeterse:masterfrom
Helkafen:master
Open

Update clock dependency#2
Helkafen wants to merge 2 commits intolpeterse:masterfrom
Helkafen:master

Conversation

@Helkafen
Copy link
Copy Markdown

The data constructors can be useful for testing.

@Helkafen
Copy link
Copy Markdown
Author

Packdeps found that clock 0.5.1 has been released, but utc.cabal requires the following bounds:

  • clock >= 0.3 && < 1
  • clock >= 0.3 && < 0.5

Is it ok to update it?

@lpeterse
Copy link
Copy Markdown
Owner

lpeterse commented Apr 25, 2016

Hi,

I'm a little hesitant with the proposed change. The reason I hide the constructors is to make illegal state unrepresentable. If at all, one might consider to export them through an Unsafe or Internal module.

If

Prelude Data.UTC> addYears 25 epoch >>= addDays 23  :: Maybe Date
Just 1995-01-24

is too tedious to write for testing it might also be a solution to add an IsString instance for Date, Time and DateTime that fails with an error on invalid input.

P.S. Thanks for noting the clock update. I will merge that one in.

@Helkafen
Copy link
Copy Markdown
Author

Yes that makes sense. Thanks for your insight.

@Helkafen Helkafen changed the title export the Date and Time data constructors Update clock dependency Apr 30, 2016
Tested with:
- GHC 7.10.3 (stackage lts-5.14)
- GHC 7.8.4 (stackage lts-2.19)

The IsString instances are kept in a separate module,
in order to respect the Safe pragmas.
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