Make Monad/Applicative instances MRP-friendly
authorHerbert Valerio Riedel <hvr@gnu.org>
Sat, 17 Oct 2015 14:47:51 +0000 (16:47 +0200)
committerBen Gamari <ben@smart-cactus.org>
Sat, 17 Oct 2015 14:51:33 +0000 (16:51 +0200)
commite8ed2136feea75f4676eb6103acd5bb1bfe35281
tree156daa80421dfdd923d3fa12c83809458f42d333
parent40cbf9aaa16fd263c54e159a4bda3a5682720041
Make Monad/Applicative instances MRP-friendly

This patch refactors pure/(*>) and return/(>>) in MRP-friendly way, i.e.
such that the explicit definitions for `return` and `(>>)` match the
MRP-style default-implementation, i.e.

  return = pure

and

  (>>) = (*>)

This way, e.g. all `return = pure` definitions can easily be grepped and
removed in GHC 8.1;

Test Plan: Harbormaster

Reviewers: goldfire, alanz, bgamari, quchen, austin

Reviewed By: quchen, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1312
40 files changed:
compiler/basicTypes/UniqSupply.hs
compiler/cmm/CmmLint.hs
compiler/cmm/PprC.hs
compiler/codeGen/StgCmmExtCode.hs
compiler/codeGen/StgCmmMonad.hs
compiler/coreSyn/CoreLint.hs
compiler/deSugar/Coverage.hs
compiler/ghci/ByteCodeAsm.hs
compiler/ghci/ByteCodeGen.hs
compiler/hsSyn/Convert.hs
compiler/llvmGen/LlvmCodeGen/Base.hs
compiler/main/CmdLineParser.hs
compiler/main/GhcMonad.hs
compiler/main/HscTypes.hs
compiler/main/PipelineMonad.hs
compiler/main/TidyPgm.hs
compiler/nativeGen/AsmCodeGen.hs
compiler/nativeGen/NCGMonad.hs
compiler/nativeGen/RegAlloc/Linear/State.hs
compiler/parser/Lexer.x
compiler/prelude/PrelRules.hs
compiler/profiling/SCCfinal.hs
compiler/rename/RnPat.hs
compiler/simplCore/CoreMonad.hs
compiler/simplCore/SimplMonad.hs
compiler/specialise/Specialise.hs
compiler/stgSyn/CoreToStg.hs
compiler/stgSyn/StgLint.hs
compiler/typecheck/TcFlatten.hs
compiler/typecheck/TcRnTypes.hs
compiler/typecheck/TcSMonad.hs
compiler/typecheck/TcTyDecls.hs
compiler/typecheck/TcType.hs
compiler/types/Unify.hs
compiler/utils/Exception.hs
compiler/utils/IOEnv.hs
compiler/utils/Maybes.hs
compiler/utils/State.hs
compiler/utils/Stream.hs
compiler/vectorise/Vectorise/Monad/Base.hs