Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,274
    • Issues 4,274
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 412
    • Merge Requests 412
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #18584

Closed
Open
Opened Aug 17, 2020 by Andrew Martin@andrewthadDeveloper

displayException is never used

Summary

The typeclass method displayException is not used. This should be remedied by either:

  1. Documenting that it does not get used anywhere (implies that there is no point in overriding the default)
  2. Using it (in base) when displaying exceptions.

Steps to reproduce

Here is an example that demonstrates that displayException is not used:

import Control.Exception

main :: IO ()
main = throwIO MyException

data MyException = MyException
  deriving (Show,Eq)

instance Exception MyException where
  displayException _ = "custom-my-exception-display"

Running this results in:

$ ./example-exception
example-exception: MyException

Expected behavior

I would expect to see:

amartin@thadtop:~/Development/test$ ./example-exception
example-exception: custom-my-exception-display
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#18584