<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
How do I write a contract for a function that takes no arguments (i.e., a thunk)?<div><br></div><div>Is it possible to write a contract specifying that the return value is a function of particular shape? Ideally, I'd like to be able to write something like</div><div><br></div><div>(-> integer? (-> integer? integer?))</div><div><br></div><div>for a function like</div><div><br></div><div>(lambda (x) (lambda (y) (+ x y)))</div><div><br></div><div>but I don't know if that's possible. (Instead, I've just used procedure? for the range.)<br><br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div><br class="Apple-interchange-newline"><br class="khtml-block-placeholder"></div><div>"Mathematics is the science of patterns."</div><div>--Lynn Arthur Steen, 1988</div><div><br></div><div><div><a href="http://www.gwoodhouse.com">http://www.gwoodhouse.com</a></div><div><a href="http://GregWoodhouse.ImageKind.com">http://GregWoodhouse.ImageKind.com</a></div><div><br></div></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline"></span> </div><br></div></body></html>