# catmaybes

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 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]
```
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 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]
```
O(n) Return a Vector of all the Just values.
Filter the Just values from a stream, discarding the Nothing values. Subject to fusion Since 0.5.1
Takes a tree of Maybes and returns a tree of all the Just values. If the root of the tree is Nothing then Nothing is returned.
The catMaybes function takes a Stream of Maybes and returns a Stream of all of the Just values. concat has the same behavior, but is more general; it works for any foldable container type.
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
Adds times in a left-associative fashion. Use this if the time is a strict data type.
```catMaybes ≡ mapMaybe id
```
```catMaybes = mapMaybe id
```
Takes a slist of Maybes and returns a slist of all the Just values.
```>>> catMaybes (cons (Just 1) \$ cons Nothing \$ one \$ Just 3)
Slist {sList = [1,3], sSize = Size 2}
```
Adds times in a right-associative fashion. Use this if the time is a data type like lazy Peano numbers or Numeric.NonNegative.Chunky.
Concatenate tiers of maybes
Generalises the catMaybes function from lists to an arbitrary MonadPlus.
Transform a fold from a pure input to a Maybe input, consuming only Just values.
Keep all Maybes and discard the Nothings.