Hoogle Search

Within LTS Haskell 24.49 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

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

    stratosphere Stratosphere.ResourceImports

    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]
    

  2. catMaybes :: forall t (m :: Type -> Type) a . (IsStream t, Monad m, Functor (t m)) => t m (Maybe a) -> t m a

    streamly Streamly.Internal.Data.Stream.IsStream

    In a stream of Maybes, discard Nothings and unwrap Justs. Pre-release

  3. mapMaybe :: forall t (m :: Type -> Type) a b . (IsStream t, Monad m) => (a -> Maybe b) -> t m a -> t m b

    streamly Streamly.Internal.Data.Stream.IsStream

    Map a Maybe returning function to a stream, filter out the Nothing elements, and return a stream of values extracted from Just. Equivalent to:

    mapMaybe f = Stream.map fromJust . Stream.filter isJust . Stream.map f
    

  4. mapMaybeM :: (IsStream t, MonadAsync m, Functor (t m)) => (a -> m (Maybe b)) -> t m a -> t m b

    streamly Streamly.Internal.Data.Stream.IsStream

    Like mapMaybe but maps a monadic function. Equivalent to:

    mapMaybeM f = Stream.map fromJust . Stream.filter isJust . Stream.mapM f
    
    Concurrent (do not use with fromParallel on infinite streams)

  5. writeMaybesWith :: forall (m :: Type -> Type) . MonadIO m => Int -> Socket -> Fold m (Maybe Word8) ()

    streamly Streamly.Internal.Network.Socket

    Write a stream of Maybe values. Keep buffering the Just values in an array. Write the array to the Handle as soon as a Nothing is encountered or the buffer size exceeds the specified limit. Pre-release

  6. mapMaybe :: forall t (m :: Type -> Type) a b . (IsStream t, Monad m) => (a -> Maybe b) -> t m a -> t m b

    streamly Streamly.Prelude

    Map a Maybe returning function to a stream, filter out the Nothing elements, and return a stream of values extracted from Just. Equivalent to:

    mapMaybe f = Stream.map fromJust . Stream.filter isJust . Stream.map f
    

  7. mapMaybeM :: (IsStream t, MonadAsync m, Functor (t m)) => (a -> m (Maybe b)) -> t m a -> t m b

    streamly Streamly.Prelude

    Like mapMaybe but maps a monadic function. Equivalent to:

    mapMaybeM f = Stream.map fromJust . Stream.filter isJust . Stream.mapM f
    
    Concurrent (do not use with fromParallel on infinite streams)

  8. putMaybeLineComment :: Maybe EpaComment -> P ()

    stylish-haskell Language.Haskell.Stylish.Printer

    No documentation available.

  9. partCompareListMaybe :: Eq a => [Maybe a] -> [Maybe a] -> Maybe Ordering

    swish Data.Ord.Partial

    Part-ordering comparison on lists of Maybe values.

  10. type BinMaybeFnApply a = a -> Bool -> BinMaybeFnDescr a -> [Maybe a] -> Maybe [a]

    swish Swish.Datatype

    altArgs support for binary function with provision for indicating inconsistent supplied values: function applicator type

Page 291 of many | Previous | Next