Proposal: System.Environment.getEnv should return Maybe

Evan Laforge qdunkan at
Thu Feb 23 00:38:44 CET 2012

Another thing that jumped out at me when I looked at the source was
that it decodes based on getFileSystemEncoding.  Given all the
brouhaha about FilePaths, maybe I can attach a rider to add a
'lookupEnvBytes :: ByteString -> IO (Maybe ByteString)' and
'getEnvironmentBytes :: IO [(ByteString, ByteString)]', since I'm
pretty sure there's no defined encoding for env vars on unix.

I hesitate to suggest it because I don't have an immediate use for it
myself, but given that we decided we wanted RawFilePath (did we?  or
did that never go into the stdlib?), maybe we can preemptively avoid
the same debate here.

More information about the Libraries mailing list