[commit: ghc] ghc-quick3: Better comment for orIfNotFound. (886f4c1)

git at git.haskell.org git at git.haskell.org
Sun Jun 5 18:38:37 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-quick3
Link       : http://ghc.haskell.org/trac/ghc/changeset/886f4c1b1c8ad5b850d3703a48d92975ed615627/ghc

>---------------------------------------------------------------

commit 886f4c1b1c8ad5b850d3703a48d92975ed615627
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Mon May 16 11:31:12 2016 -0700

    Better comment for orIfNotFound.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>


>---------------------------------------------------------------

886f4c1b1c8ad5b850d3703a48d92975ed615627
 compiler/main/Finder.hs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/compiler/main/Finder.hs b/compiler/main/Finder.hs
index e11480c..446cdf8 100644
--- a/compiler/main/Finder.hs
+++ b/compiler/main/Finder.hs
@@ -141,7 +141,11 @@ findExactModule hsc_env mod =
 -- -----------------------------------------------------------------------------
 -- Helpers
 
-orIfNotFound :: IO FindResult -> IO FindResult -> IO FindResult
+-- | Given a monadic actions @this@ and @or_this@, first execute
+-- @this at .  If the returned 'FindResult' is successful, return
+-- it; otherwise, execute @or_this at .  If both failed, this function
+-- also combines their failure messages in a reasonable way.
+orIfNotFound :: Monad m => m FindResult -> m FindResult -> m FindResult
 orIfNotFound this or_this = do
   res <- this
   case res of



More information about the ghc-commits mailing list