Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,348
    • Issues 5,348
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 565
    • Merge requests 565
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #5930
Closed
Open
Issue created Mar 12, 2012 by elaforge@trac-elaforge

add System.Environment.lookupEnv which returns Maybe instead of an exception

getEnv throws an exception when the key isn't found, which is surprising and inconvenient. I'd prefer to change the signature of getEnv to return Maybe, but that will break people's code, so I'll settle for a new lookupEnv function.

It's been discussed on libraries@haskell.org and there was unanimous support.

Patches attached, the first cleans up mixed tabs and spaces (which I understand has been happening in ghc lately). The second adds the new function. Unfortunately I still can't get ghc to compile so it's untested for now. I'll keep trying with GHC, but I don't have a windows machine for testing.

Trac metadata
Trac field Value
Version 7.4.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking