Skip to content

Use fixed-width integers to represent days #68

Description

@charles-cooper

Currently https://hackage.haskell.org/package/time-1.8.0.1/docs/Data-Time-Calendar.html#t:Day is represented in memory as an Integer, and many similar functions like fromGregorian which interface with Integers. While this is admirably future-proof (we can deal with years larger than the year 2,147,481,790 AD!) I think we will be using intuitionistic type theory sooner than we will need those dates :)

Using something like Int32 would give us nearly the same flexibility, better Storable instances, interfacing with C and serialization/deserialization. I'm not sure how much this will break downstream code, but I have a feeling most people are using fromIntegral to interface with the API anyways, and this change will actually lessen the amount of marshalling people need to do.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions