serokell / o-clock

:hourglass: Type-safe time units in Haskell
Mozilla Public License 2.0
49 stars 6 forks source link

Implement 'seriesP . seriesF @AnyList ≡ id' testing property #64

Open chshersh opened 6 years ago

chshersh commented 6 years ago

After #60 and #63 is done we can implement such property. Though it's really difficult to implement this as it seems to me...

  1. We need to somehow generate random type-level list of time units.
  2. We need to think of a way to make seriesF result actually meaningful. We don't want to generate 1234 picoseconds and format this with lists [Hour, Minute, Second] very often.
chshersh commented 6 years ago

I think for now we can just have tests with unitsF and unitsP and only much later think on more sophisticated tests.

chshersh commented 6 years ago

For generating random type level lists we could use trick suggested in this tweet: