It is mostly because those libraries are far older than Text and ByteString, so String was the only choice at the time. Modernizing them is good.. but would also break a lot of code. And in many core libraries, the functions are required to have String types in order to be Haskell 98 compliant.
So, modernization is good. But also requires significant effort, and someone willing to make that effort.
The content of URIs is defined in terms of octets in the RFC,
and all Posix interfaces are byte streams and C strings, not
character strings. Yet in Haskell, we find these objects exposed
with String interfaces:
> :info Network.URI.URI
data URI
= URI {uriScheme :: String,
uriAuthority :: Maybe URIAuth,
uriPath :: String,
uriQuery :: String,
uriFragment :: String}
-- Defined in Network.URI
> :info System.Posix.Env.getEnvironment
System.Posix.Env.getEnvironment :: IO [(String, String)]
-- Defined in System.Posix.Env
But there is no law that environment variables must be made of
characters:
:; export x=$'\xFF' ; echo -n $x | xxd -p
ff
:; locale
LANG="en_US.UTF-8"
That the relationship between bytes and characters can be
confusing, both in working with UNIX and in dealing with web
protocols, is undeniable -- but it seems unwise to limit the
options available to Haskell programmers in dealing with these
systems.
--
Jason Dusek
pgp // solidsnack // C1EBC57DC55144F35460C8DF1FD4C6C1FED18A2B
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe