[GHC] #9328: MINIMAL pragma should supprt negation

#9328: MINIMAL pragma should supprt negation -------------------------------------+------------------------------------- Reporter: augustss | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Keywords: | Differential Revisions: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: -------------------------------------+------------------------------------- Consider this class declaration {{{ class Conv a where to :: Integer -> a from :: a -> Integer default to :: (Generic a) => Integer -> a to i = ... default from :: (Generic a) => a -> Integer from a = ... }}} The class provides default methods for the two methods using generics. An instance declaration for this type is likely to want to use the default for both methods or for none. So I'd like a MINIMAL pragma that can express this. E.g. {{{ {-# MINIMAL (to, from) | (!to, !from) #-} }}} I've used ! for negation (following the lead set by the MINIMAL pragma using a non-Haskell OR operator), so this says: either implement 'to' and 'from' or don't implement neither 'to' nor 'from'. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9328 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9328: MINIMAL pragma should supprt negation -------------------------------------+------------------------------------- Reporter: augustss | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.8.3 Component: Compiler | Keywords: Resolution: | Operating System: Unknown/Multiple Differential Revisions: | Type of failure: None/Unknown Architecture: | Test Case: Unknown/Multiple | Blocking: Difficulty: Unknown | Blocked By: | Related Tickets: | -------------------------------------+------------------------------------- Comment (by nomeata): That’s no longer a statement of what instances are `MINIMAL`, but rather a complete description of sensible instantiations, isn’t it? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9328#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9328: MINIMAL pragma should supprt negation -------------------------------------+------------------------------------- Reporter: augustss | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by augustss): Yes, you could say that. Implementing nothing is `MINIMAL`, but if you implement `to` you must also implement `from` (and v.v.). But I think it's a natural extension of the `MINIMAL` pragma. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9328#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC