soft-contract
soft-contract copied to clipboard
Handle error function
This program should not verify (error is currently unbound):
(module f racket
(provide (contract-out [f (integer? . -> . integer?)]))
(define (f n)
(error "Asdf")))
Does it work just to give error a ... -> none/c contract?
If we take the blamed party into account:
This:
(module lib racket
(provide/contract [error (any/c . -> . none/c)]))
will blame the module providing error, while this:
(module lib racket
(provide/contract [error (none/c . -> . any/c)]))
will blame whoever calling error. Is the second closer to what we want?
There are some deep questions about what we want here, but I think we want no one to be blamed, at least to start.