We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fx+/wraparound
Here's a motivating example, inspired by the discussion on Discord:
#lang typed/racket/base (: fib (-> Nonnegative-Fixnum Nonnegative-Fixnum)) (define (fib n) (let loop ([n : Nonnegative-Fixnum n] [prev : Nonnegative-Fixnum 0] [cur : Nonnegative-Fixnum 1]) (cond [(= n 0) prev] [(= n 1) cur] [else (loop (- n 1) cur (abs (fx+/wraparound prev cur)))]))) ;; Shouldn't need this! (require typed/racket/unsafe) (unsafe-require/typed racket/unsafe/ops [(unsafe-fxabs abs) (-> Fixnum Nonnegative-Fixnum)] [(unsafe-fx+/wraparound fx+/wraparound) (-> Fixnum Fixnum Fixnum)])
Maybe there should be a CI test for certain modules that all of their functions have type information?
The text was updated successfully, but these errors were encountered:
abs
(-> Fixnum Nonnegative-Fixnum)
No branches or pull requests
Here's a motivating example, inspired by the discussion on Discord:
Maybe there should be a CI test for certain modules that all of their functions have type information?
The text was updated successfully, but these errors were encountered: