[plt-dev] typed scheme/path

From: harsha (harsha.v.r at gmail.com)
Date: Fri Feb 27 15:24:43 EST 2009

Below is typed scheme/path,
The typed version of normalize-path doesn't allow an optional argument.

; path.ss
; LGPL licensed

#lang typed-scheme

(define-type-alias Path/str (U Path String))
(define-type-alias Path-string String)

(require/typed scheme/path
               [explode-path (Path/str -> (Listof (U Path 'up 'same)))]
               [find-relative-path (Path/str Path/str -> Path)]
               [simple-form-path (Path-string -> Path)]
               [normalize-path (Path-string -> Path)]  ; doesn't allow an
optional argument
               [filename-extension (Path/str -> (Option Bytes))]
               [file-name-from-path (Path/str -> (Option Path))]
               [path-only (Path/str -> Path)]
               [some-system-path->string (Path -> String)]
               [string->some-system-path (String (U 'unix 'windows) ->
Path)])

(provide find-relative-path
         explode-path
         simple-form-path
         normalize-path
         filename-extension
         file-name-from-path
         path-only
         some-system-path->string
         string->some-system-path)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20090227/6246d163/attachment.html>

Posted on the dev mailing list.