<div>Thanks for the previous TR assist.   <br></div><div>I tried manually annotating stuff inside the &#39;get&#39; procedure below but can&#39;t seem to get it to type check.</div><div>Thanks again in advance.</div><div><br>
</div><div>(struct: (T) Try ())</div><div><br></div><div>(struct: (T) Failure Try ([exception : exn]))</div><div><br></div><div>(struct: (T) Success Try ([result : T]))</div><div><br></div><div>(: failed (All (T) (Try T) -&gt; Boolean))</div>
<div>(define (failed try)</div><div>  (Failure? try))</div><div><br></div><div>(: succeded (All (T) (Try T) -&gt; Boolean))</div><div>(define (succeded try)</div><div>  (Success? try))</div><div><br></div><div>(: get (All (T) (Try T) -&gt; T))</div>
<div>(define (get try)</div><div>  (cond</div><div>   ((Failure? try) (raise (Failure-exception try)))</div><div>   ((Success? try) (Success-result try))</div><div>   (else (error &quot;Can I not be &#39;sealed&#39;&quot;))))</div>
<div> </div><div>(: tmap (All (T U) (Try T) (T -&gt; U) -&gt; (Try U)))</div><div>(define (tmap try fn)</div><div>  (cond </div><div>   ((Success? try)</div><div>    (Try (fn (Success-result try))))</div><div>   ((Failure? try) try)</div>
<div>   (else (error &quot;hmmmm&quot;))))</div><div> </div><div>(: attempt (Try String))</div><div>(define attempt (Success &quot;Good to go&quot;))</div><div>   </div><div>(: test  (-&gt; String))</div><div>(define (test)</div>
<div>  (if (succeded attempt)</div><div>      (get attempt)</div><div>      &quot;aborted&quot;))</div><div>  </div>