Hoogle Search
Within LTS Haskell 24.39 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
yaya Yaya.Pattern Isomorphic to (a, Maybe b), it’s also the pattern functor for non-empty lists.
andMaybe :: (a -> c) -> (a -> b -> c) -> AndMaybe a b -> cyaya Yaya.Pattern -
bytesmith Data.Bytes.Parser No documentation available.
-
bytesmith Data.Bytes.Parser No documentation available.
parseBytesMaybe :: (forall s . () => Parser e s a) -> Bytes -> Maybe abytesmith Data.Bytes.Parser Variant of parseBytesEither that discards the error message on failure. Just like parseBytesEither, this does not impose any checks on the length of the remaining input.
type
SourceRepoMaybe = SourceRepositoryPackage Maybecabal-install-parsers Cabal.SourceRepo Distilled from SourceRepo
catMaybes :: (Contiguous arr, Element arr a, Element arr (Maybe a)) => arr (Maybe a) -> arr acontiguous Data.Primitive.Contiguous The catMaybes function takes a list of Maybes and returns a list of all the Just values.
-
contiguous Data.Primitive.Contiguous The mapMaybe function is a version of map which can throw out elements. In particular, the functional arguments returns something of type Maybe b. If this is Nothing, no element is added on to the result array. If it is Just b, then b is included in the result array.
mapMaybe :: Ord k => (a -> Maybe b) -> Map k a -> Map k bdhall Dhall.Map Transform all values in a Map using the supplied function, deleting the key if the function returns Nothing
>>> mapMaybe Data.Maybe.listToMaybe (fromList [("C",[1]),("B",[]),("A",[3])]) fromList [("C",1),("A",3)]-
foundation Foundation 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]