
#8185: Change role annotation syntax ----------------------------+---------------------------------------------- Reporter: | Owner: goldfire goldfire | Status: new Type: feature | Milestone: 7.8.1 request | Version: 7.7 Priority: normal | Keywords: Component: | Architecture: Unknown/Multiple Compiler | Difficulty: Moderate (less than a day) Resolution: | Blocked By: Operating System: | Related Tickets: Unknown/Multiple | Type of failure: | None/Unknown | Test Case: | Blocking: | ----------------------------+---------------------------------------------- Changes (by ekmett): * cc: ekmett@… (added) Comment: Simon, While I can respect the fact that other pragmas are forgettable without changing the compilability of the program, the big issue to me here is that by introducing Roles we're forcing users to choose between backwards compatibility and compatibility with other compilers, correctness under GHC and doing the right thing and putting on annotations when they need invariants. With a ```{-# ROLE #-}``` pragma users can at least write code that could work with other compilers without requiring an ```#ifdef``` block around every container type that provides invariants. I expect these to be a lot more common than Richard seems to, given that almost any sort of `Map`, `Set`, `Fingertree` or `Heap`-like data structure makes use of some invariant about its contents. I've been compiling a mental checklist of my own packages that will break when this goes in and it isn't a small list. It seems to me that this means any package that provides basically any sort of container is going to have to compile with `#ifdef`, which is a really ugly consequence of the current syntax. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8185#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler