[Haskell-cafe] File path programme

Simon Marlow simonmar at microsoft.com
Wed Jan 26 10:53:20 EST 2005


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

> Not at all. You just include some nice operation in the class:
> 
> emptyPath :: Path p => p
> appendPath :: Path p => p -> String -> p
> 
> etc...
> 
> So it is an abstract datatype and class. The user never needs to touch
> the concrete type, even though they use it... The types remain
> polymophic. 

The types can't remain completely polymorphic - at some point you have
to say what type you want.  Because an ambiguous Path constraint cannot
be resolved, the program will have to mention either Win32Path or
PosixPath, at which point it becomes non-portable without conditinoal
compilation.

Cheers,
	Simon


More information about the Libraries mailing list