[Haskell-cafe] File path programme

Simon Marlow simonmar at microsoft.com
Wed Jan 26 10:56:05 EST 2005


On 26 January 2005 15:50, Keean Schupke wrote:

> You could define a type in the library using conditional compilation:
> 
> #ifdef Unix
>     type SystemPath = UnixPath
> #endif
> 
> #ifdef Windows
>     type SystemPath = WindowsPath
> #endif
> 
> 
> Then you do:
> 
> let myPath = (emptyPath :: SystemPath) in ...

Portable library APIs are not supposed to vary between platforms.

Cheers,
	Simon


More information about the Libraries mailing list