[Haskell] System.FilePath survey

Ben Rudiak-Gould Benjamin.Rudiak-Gould at cl.cam.ac.uk
Wed Feb 8 15:53:04 EST 2006


David Roundy wrote:
> being able to write
> 
>   writeFile "output" contents
> 
> would seem to me to be worth the complexity of having a class [for pathnames].

I'd rather give string constants the type Str a => a, with

     class Str a where
       fromASCII :: ByteArray -> a
       fromUTF8  :: ByteArray -> a

and declare an instance for the pathname ADT. GHC already handles string 
constants this way internally. Of course, this becomes yet another source of 
unresolved overloadings and confusion for newbies.

-- Ben



More information about the Libraries mailing list