
#9819: Create typesafe method of obtaining dictionary types from class definitions, and constraint objects from dictionary types -------------------------------------+------------------------------------- Reporter: | Owner: spacekitteh | Status: new Type: feature | Milestone: request | Version: Priority: normal | Keywords: Component: Compiler | Architecture: Unknown/Multiple Resolution: | Difficulty: Moderate (less Operating System: | than a day) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by spacekitteh): Upon perusing the dictionary creation source some more, it appears that it could be implemented by changing adding a flag to {{{ mkClassDataConOcc = mk_simple_deriv dataName "D:" -- We go straight to the "real" data con -- for datacons from classes }}} in compiler/basicTypes/OccName.hs like so {{{ mkClassDataConOcc True = mk_simple_deriv dataName "" mkClassDataConOcc False = mk_simple_deriv dataName "D:" }}} and change buildClass in compiler/iface/BuildTyCl.hs from: {{{ ... ; datacon_name <- newImplicitBinder tycon_name mkClassDataConOcc }}} to {{{ ; datacon_name <- newImplicitBinder tycon_name (mkClassDataConOcc visibleConstructor) }}} This would require modifying buildClass to accept DynFlags, though. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9819#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler