Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
Source project has a limited visibility.
  • Austin Seipp's avatar
    75a9664a
    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
    History
    Implement the AMP warning (#8004)
    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>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.