diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-05-16 11:31:12 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-06-05 11:41:58 -0700 |
commit | 886f4c1b1c8ad5b850d3703a48d92975ed615627 (patch) | |
tree | 7a2e86a0a3276c1da96df2857a006cabe2446934 | |
parent | 4848ab9ce3c4491935888d405412d451294b74ee (diff) | |
download | haskell-886f4c1b1c8ad5b850d3703a48d92975ed615627.tar.gz |
Better comment for orIfNotFound.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
-rw-r--r-- | compiler/main/Finder.hs | 6 |
1 files changed, 5 insertions, 1 deletions
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 |