I suspect it would look something along the lines of:
#lang racket/load
(module m racket
(provide/contract [foo (-> (-> any/c))])
(define (foo)
(+ 10 3) ; do something
(lambda ()
(+ 40 2) ; do other things
)))
(module n racket
(require 'm)
((foo)))
(require 'n)
(-> (-> any/c))
is a contract that matches functions that returns another function, which, when evaluated, returns a single integer value.
But if you'd like to relax return values of foo
, you'd use just any
instead of any/c
, which allows any number of return values, not just a single value. Consider:
(module m racket
(provide/contract [foo (-> (-> any))])
(define (foo)
(+ 10 3) ; do something
(lambda ()
(values (+ 40 2) 666); do other things
)))
See Contracts on Higher-order Functions in Racket documentation.