;path.ss<br>;LGPL licensed<br><br>#lang typed-scheme<br><br>(require/opaque-type Path-for-some-system path-for-some-system? scheme)<br>(define-type-alias String/Path-for-some-system (U String Path-for-some-system))<br>(define-type-alias String/Path (U String Path))<br>
<br>(require/typed scheme/path<br>               [find-relative-path (String/Path-for-some-system String/Path-for-some-system -&gt; Path-for-some-system)]               <br>               [explode-path (String/Path-for-some-system -&gt; (Listof (U Path-for-some-system &#39;up &#39;same)))]<br>
               [simple-form-path (String/Path -&gt; Path)]<br>               [normalize-path<br>                (case-lambda (String/Path -&gt; Path)<br>                             (String/Path String/Path -&gt; Path))] ;second argument can be made more expressive by using a complete-path opaque type<br>
               [filename-extension (String/Path-for-some-system -&gt; (Option Bytes))]<br>               [file-name-from-path (String/Path-for-some-system -&gt; (Option Path-for-some-system))]<br>               [path-only (String/Path-for-some-system -&gt; Path-for-some-system)]<br>
               [some-system-path-&gt;string (Path-for-some-system -&gt; String)]<br>               [string-&gt;some-system-path (String (U &#39;unix &#39;windows) -&gt; Path-for-some-system)])<br><br>(provide find-relative-path<br>
         explode-path<br>         simple-form-path<br>         normalize-path<br>         filename-extension<br>         file-name-from-path<br>         path-only<br>         some-system-path-&gt;string<br>         string-&gt;some-system-path)<br>
<br>