[plt-dev] typed scheme/path
harsha wrote:
> i just went back and checked and Path type doesn't include
> Path-for-some-system
> (string->some-system-path "file" 'windows) fails to type check as its
> output is supposed to be Path, but it returns a windows-path (i am on unix).
You can do the following:
#lang typed-scheme
(require/opaque-type Some-System-Path path-for-some-system? scheme)
(require/typed scheme/path
[string->some-system-path
(String (U 'windows 'unix) -> Some-System-Path)])
(string->some-system-path "file" 'windows)
David