[GHC] #13114: UniqSet definition seems shady
GHC
ghc-devs at haskell.org
Fri Jan 13 03:18:44 UTC 2017
#13114: UniqSet definition seems shady
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: dfeuer
Type: task | Status: new
Priority: low | Milestone: 8.4.1
Component: Compiler | Version: 8.1
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
Currently,
{{{#!hs
type UniqSet a = UniqFM a
}}}
The key invariant of `UniqSet` is expressed in the somewhat-poorly-named
`Note [Unsound mapUniqSet]`, and not enforced by the types. It seems
likely that the clean thing is
{{{#!hs
newtype UniqSet a = US (UniqFM a)
}}}
Unfortunately there's an awful lot of code using `UniqSet` and assuming
it's the same as `UniqFM`. To make this work, we'd need to expand the
`UniqSet` API somewhat and figure out what to do at use sites using it
interchangeably with `UniqFM`.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13114>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list