RE: [Haskell-cafe] File path programme

26 Jan
2005
26 Jan
'05
10:53 a.m.
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
7419
Age (days ago)
7419
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Marlow