Hoogle Search
Within LTS Haskell 24.38 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
fromMaybeOr :: Maybe a -> a -> afrom-sum Control.FromSum fromMaybeOrExceptT :: forall (m :: Type -> Type) a x . Monad m => Maybe a -> x -> ExceptT x m afrom-sum Control.FromSum Just like fromMaybeExceptT but with the arguments flipped.
fromMaybeOrM :: Applicative m => Maybe a -> m a -> m afrom-sum Control.FromSum A fliped version of fromMaybeM.
>>> fromMaybeOrM (Just 5) [] [5]
This can be nice to use as an error handler.>>> fromMaybeOrM (Just 5) $ putStrLn "some error occurred" >> undefined 5 >>> fromMaybeOrM (Nothing) $ putStrLn "some error occurred" >> undefined some error occurred ...
fromMaybeOrMExceptT :: Monad m => m (Maybe a) -> x -> ExceptT x m afrom-sum Control.FromSum Just like fromMaybeMExceptT but with the arguments flipped.
fromMaybeOrMM :: Monad m => m (Maybe a) -> m a -> m afrom-sum Control.FromSum A fliped version of fromMaybeMM.
fromMaybeOrM_ :: (Applicative m, Monoid b) => Maybe a -> m b -> m bfrom-sum Control.FromSum A fliped version of fromMaybeM.
parseFrontmatterMaybe :: ByteString -> Maybe ByteStringfrontmatter Data.Frontmatter parseFrontmatter but returning a Maybe
parseYamlFrontmatterMaybe :: FromJSON a => ByteString -> Maybe afrontmatter Data.Frontmatter parseYamlFrontmatter but returning a Maybe
-
github GitHub.Internal.Prelude The catMaybes function takes a list of Maybes and returns a list of all the Just values.
Examples
Basic usage:>>> catMaybes [Just 1, Nothing, Just 3] [1,3]
When constructing a list of Maybe values, catMaybes can be used to return all of the "success" results (if the list is the result of a map, then mapMaybe would be more appropriate):>>> import GHC.Internal.Text.Read ( readMaybe ) >>> [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ] [Just 1,Nothing,Just 3] >>> catMaybes $ [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ] [1,3]
-
github GitHub.Request Helper for picking between executeRequest and executeRequest'. The use is discouraged.