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.

  1. catMaybes :: [Maybe a] -> [a]

    strict Data.Strict.Maybe

    Analogous to catMaybes in Data.Maybe.

  2. fromMaybe :: a -> Maybe a -> a

    strict 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.

  3. listToMaybe :: [a] -> Maybe a

    strict Data.Strict.Maybe

    Analogous to listToMaybe in Data.Maybe.

  4. mapMaybe :: (a -> Maybe b) -> [a] -> [b]

    strict Data.Strict.Maybe

    Analogous to mapMaybe in Data.Maybe.

  5. combSpanMaybe :: SrcSpanInfo -> Maybe SrcSpanInfo -> SrcSpanInfo

    haskell-src-exts Language.Haskell.Exts.SrcLoc

    Like (<+?>), but it also concatenates the srcInfoPoints.

  6. 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

  7. 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

  8. catMaybes :: (IsSequence (f (Maybe t)), Functor f, Element (f (Maybe t)) ~ Maybe t) => f (Maybe t) -> f t

    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

  9. leftToMaybe :: Either a b -> Maybe a

    either Data.Either.Combinators

    Maybe get the Left side of an Either.

    leftToMaybeeither Just (const Nothing)
    
    Using Control.Lens:
    leftToMaybe ≡ preview _Left
    leftToMaybe x ≡ x^?_Left
    
    >>> leftToMaybe (Left 12)
    Just 12
    
    >>> leftToMaybe (Right 12)
    Nothing
    

  10. rightToMaybe :: Either a b -> Maybe b

    either Data.Either.Combinators

    Maybe get the Right side of an Either.

    rightToMaybeeither (const Nothing) Just
    
    Using Control.Lens:
    rightToMaybe ≡ preview _Right
    rightToMaybe x ≡ x^?_Right
    
    >>> rightToMaybe (Left 12)
    Nothing
    
    >>> rightToMaybe (Right 12)
    Just 12
    

Page 157 of many | Previous | Next