Skip to content
  • Austin Seipp's avatar
    Implement the AMP warning (#8004) · 75a9664a
    Austin Seipp authored
    
    
    This patch implements a warning when definitions conflict with the
    Applicative-Monad Proposal (AMP), described in #8004. Namely, this will
    cause a warning iff:
    
        * You have an instance of Monad, but not Applicative
        * You have an instance of MonadPlus, but not Alternative
        * You locally defined a function named join, <*>, or pure.
    
    In GHC 7.10, these warnings will actually be enforced with superclass
    constraints through changes in base, so programs will fail to compile
    then.
    
    This warning is enabled by default. Unfortunately, not all of
    our upstream libraries have accepted the appropriate patches. So we
    temporarily fix ./validate by ignoring the AMP warning.
    
    Dan Rosén made an initial implementation of this change, and the
    remaining work was finished off by David Luposchainsky. I finally made
    some minor refactorings.
    
    Authored-by: default avatarDan Rosén <danr@chalmers.se>
    Authored-by: default avatarDavid Luposchainsky <dluposchainsky@gmail.com>
    Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
    75a9664a