util.ss
#lang typed/scheme
(provide (all-defined-out))

(require (planet cce/scheme:7/planet))
(require/typed (this-package-in private/util)
               [exact-round (Real -> Integer)]
               [exact-floor (Real -> Integer)]
               [exact-ceiling (Real -> Integer)]
               [exact-truncate (Real -> Integer)])

(: cast (All (T) ((Any -> Boolean : T) Any -> T)))
(define (cast p? x)
  (if (p? x)
      x
      (error "Cast failed")))

(define-syntax-rule (sngl e)
  (ann e e))