From 886f4c1b1c8ad5b850d3703a48d92975ed615627 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Mon, 16 May 2016 11:31:12 -0700 Subject: Better comment for orIfNotFound. Signed-off-by: Edward Z. Yang --- 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 e11480c497..446cdf87e5 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@. If the returned 'FindResult' is successful, return +-- it; otherwise, execute @or_this@. 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 -- cgit v1.2.1