Hoogle Search
Within LTS Haskell 24.32 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
strict Data.Strict.Maybe Analogous to catMaybes in Data.Maybe.
fromMaybe :: a -> Maybe a -> astrict Data.Strict.Maybe Given a default value and a Maybe, yield the default value if the Maybe argument is Nothing and extract the value out of the Just otherwise.
-
strict Data.Strict.Maybe Analogous to listToMaybe in Data.Maybe.
mapMaybe :: (a -> Maybe b) -> [a] -> [b]strict Data.Strict.Maybe Analogous to mapMaybe in Data.Maybe.
combSpanMaybe :: SrcSpanInfo -> Maybe SrcSpanInfo -> SrcSpanInfohaskell-src-exts Language.Haskell.Exts.SrcLoc Like (<+?>), but it also concatenates the srcInfoPoints.
contramapMaybe :: (a -> Maybe b) -> OutputStream b -> IO (OutputStream a)io-streams System.IO.Streams.Combinators Contravariant counterpart to contramapMaybe. contramap f s passes all input to s through the function f. Discards all the elements for which f returns Nothing. Since: 1.2.1.0
mapMaybe :: (a -> Maybe b) -> InputStream a -> IO (InputStream b)io-streams System.IO.Streams.Combinators A version of map that discards elements mapMaybe f s passes all output from s through the function f and discards elements for which f s evaluates to Nothing. Example:
ghci> Streams.fromList [Just 1, None, Just 3] >>= Streams.mapMaybe id >>= Streams.toList [1,3]
Since: 1.2.1.0-
mono-traversable Data.Sequences Takes all of the Just values from a sequence of Maybe ts and concatenates them into an unboxed sequence of ts. Since 0.6.2
leftToMaybe :: Either a b -> Maybe aeither Data.Either.Combinators Maybe get the Left side of an Either.
leftToMaybe ≡ either Just (const Nothing)
Using Control.Lens:leftToMaybe ≡ preview _Left leftToMaybe x ≡ x^?_Left
>>> leftToMaybe (Left 12) Just 12
>>> leftToMaybe (Right 12) Nothing
rightToMaybe :: Either a b -> Maybe beither Data.Either.Combinators Maybe get the Right side of an Either.
rightToMaybe ≡ either (const Nothing) Just
Using Control.Lens:rightToMaybe ≡ preview _Right rightToMaybe x ≡ x^?_Right
>>> rightToMaybe (Left 12) Nothing
>>> rightToMaybe (Right 12) Just 12