Skip to content

MINIMAL pragma should supprt negation

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'.

Trac metadata
Trac field Value
Version 7.8.3
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information