Skip to content

Instantly share code, notes, and snippets.

@philnguyen
Created August 28, 2019 16:18
Show Gist options
  • Save philnguyen/6846a534da7d27d576a65e9dc4e8b544 to your computer and use it in GitHub Desktop.
Save philnguyen/6846a534da7d27d576a65e9dc4e8b544 to your computer and use it in GitHub Desktop.
#lang racket
(require soft-contract/fake-contract)
(struct tzgap (starts-at offset-before offset-after) #:transparent)
(struct tzoffset (utc-seconds dst? abbreviation) #:transparent)
(struct tzoverlap (offset-before offset-after) #:transparent)
(define tz? (or/c string? exact-integer?))
(define system-tzid #:opaque)
(define local-seconds->tzoffset #:opaque)
(define utc-seconds->tzoffset #:opaque)
(provide
(contract-out
[system-tzid (-> (or/c #f tz?))]
[struct tzgap ([starts-at exact-nonnegative-integer?]
[offset-before tzoffset?]
[offset-after tzoffset?])]
[struct tzoffset ([utc-seconds exact-integer?]
[dst? boolean?]
[abbreviation string?])]
[struct tzoverlap ([offset-before tzoffset?]
[offset-after tzoffset?])]
[local-seconds->tzoffset (-> string? exact-integer? (or/c tzoffset? tzgap? tzoverlap?))]
[utc-seconds->tzoffset (-> string? (and/c rational? exact?) tzoffset?)]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment