X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Futils%2FMaybes.lhs;h=3f94d346210705ae6cf1d174b5bf2a2e823782ec;hb=99073d876ea762016683fb0b22b9d343ff864eb4;hp=abaf1c1dada72d9923453234d0be279f2d4d9216;hpb=323fee1e8cbabe604496a1b92c6de0e98ca037e4;p=ghc-hetmet.git diff --git a/ghc/compiler/utils/Maybes.lhs b/ghc/compiler/utils/Maybes.lhs index abaf1c1..3f94d34 100644 --- a/ghc/compiler/utils/Maybes.lhs +++ b/ghc/compiler/utils/Maybes.lhs @@ -15,13 +15,10 @@ module Maybes ( expectJust, maybeToBool, - failMaB, - failMaybe, - seqMaybe, - returnMaB, - returnMaybe, - thenMaB, - catMaybes + thenMaybe, seqMaybe, returnMaybe, failMaybe, catMaybes, + + thenMaB, returnMaB, failMaB + ) where #include "HsVersions.h" @@ -104,6 +101,11 @@ seqMaybe :: Maybe a -> Maybe a -> Maybe a seqMaybe (Just x) _ = Just x seqMaybe Nothing my = my +thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b +thenMaybe ma mb = case ma of + Just x -> mb x + Nothing -> Nothing + returnMaybe :: a -> Maybe a returnMaybe = Just