base -Data.Maybe  

<p>The <code><a href="/?query=%28%28name%3A%28%21catMaybes%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21catMaybes%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21catMaybes%29">catMaybes</a></code> function takes a list of <code><a href="/?query=%28%28name%3A%28%21Maybe%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Maybe%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21Maybe%29">Maybe</a></code>s and returns a list of all the <code><a href="/?query=%28%28name%3A%28%21Just%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Just%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21Just%29">Just</a></code> values.</p><h4 id="control.ch:catMaybes0" class="caption collapser" onclick="toggleSection('ch:catMaybes0')">Examples</h4><div id="section.ch:catMaybes0" class="hide"><p>Basic usage:</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>catMaybes [Just 1, Nothing, Just 3] </code></strong>[1,3] </pre><p>When constructing a list of <code><a href="/?query=%28%28name%3A%28%21Maybe%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Maybe%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21Maybe%29">Maybe</a></code> values, <code><a href="/?query=%28%28name%3A%28%21catMaybes%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21catMaybes%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21catMaybes%29">catMaybes</a></code> can be used to return all of the "success" results (if the list is the result of a <code><a href="/?query=%28%28name%3A%28%21map%29%20package%3A%28%21base%29%20module%3A%28%21GHC.OldList%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21map%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21map%29">map</a></code>, then <code><a href="/?query=%28%28name%3A%28%21mapMaybe%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21mapMaybe%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21mapMaybe%29">mapMaybe</a></code> would be more appropriate):</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>import Text.Read ( readMaybe ) </code></strong><code class="prompt">>>> </code><strong class="userinput"><code>[readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ] </code></strong>[Just 1,Nothing,Just 3] <code class="prompt">>>> </code><strong class="userinput"><code>catMaybes $ [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ] </code></strong>[1,3] </pre></div>
catMaybes :: Monad m => Conduit (Maybe a) m a

conduit -Data.Conduit.List  

<p>Filter the <code>Just</code> values from a stream, discarding the <code>Nothing</code> values.</p><p>Subject to fusion</p><p>Since 0.5.1</p>

haskell98 -Maybe  

<p>The <code><a href="/?query=%28%28name%3A%28%21catMaybes%29%20package%3A%28%21haskell98%29%20module%3A%28%21Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21catMaybes%29%20package%3A%28%21haskell98%29%29%5E10.0%29%20OR%20name%3A%28%21catMaybes%29">catMaybes</a></code> function takes a list of <code><a href="/?query=%28%28name%3A%28%21Maybe%29%20package%3A%28%21haskell98%29%20module%3A%28%21Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Maybe%29%20package%3A%28%21haskell98%29%29%5E10.0%29%20OR%20name%3A%28%21Maybe%29">Maybe</a></code>s and returns a list of all the <code><a href="/?query=%28%28name%3A%28%21Just%29%20package%3A%28%21haskell98%29%20module%3A%28%21Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Just%29%20package%3A%28%21haskell98%29%29%5E10.0%29%20OR%20name%3A%28%21Just%29">Just</a></code> values. </p>

HaXml -Text.XML.HaXml.XmlContent.Parser  

<p>The <code><a href="/?query=%28%28name%3A%28%21catMaybes%29%20package%3A%28%21HaXml%29%20module%3A%28%21Text.XML.HaXml.XmlContent.Parser%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21catMaybes%29%20package%3A%28%21HaXml%29%29%5E10.0%29%20OR%20name%3A%28%21catMaybes%29">catMaybes</a></code> function takes a list of <code><a href="/?query=%28%28name%3A%28%21Maybe%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Maybe%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21Maybe%29">Maybe</a></code>s and returns a list of all the <code><a href="/?query=%28%28name%3A%28%21Just%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Just%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21Just%29">Just</a></code> values. </p>
catMaybes :: (IsSequence (f (Maybe t)), Functor f, Element (f (Maybe t)) ~ Maybe t) => f (Maybe t) -> f t

mono-traversable -Data.Sequences  

<p>Takes all of the <code><a href="/?query=%28%28name%3A%28%21Just%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Just%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21Just%29">Just</a></code> values from a sequence of <code>Maybe t</code>s and concatenates them into an unboxed sequence of <code>t</code>s.</p><p>Since 0.6.2</p>
catMaybes :: C time => T time (Maybe body) -> T time body

event-list -Data.EventList.Relative.TimeBody  

<p>Adds times in a left-associative fashion. Use this if the time is a strict data type.</p>
catMaybes :: C time => T time (Maybe body) -> T time body

event-list -Data.EventList.Relative.TimeTime  

<p>Adds times in a left-associative fashion. Use this if the time is a strict data type.</p>

basic-prelude -CorePrelude  

<p>The <code><a href="/?query=%28%28name%3A%28%21catMaybes%29%20package%3A%28%21basic-prelude%29%20module%3A%28%21CorePrelude%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21catMaybes%29%20package%3A%28%21basic-prelude%29%29%5E10.0%29%20OR%20name%3A%28%21catMaybes%29">catMaybes</a></code> function takes a list of <code><a href="/?query=%28%28name%3A%28%21Maybe%29%20package%3A%28%21basic-prelude%29%20module%3A%28%21CorePrelude%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Maybe%29%20package%3A%28%21basic-prelude%29%29%5E10.0%29%20OR%20name%3A%28%21Maybe%29">Maybe</a></code>s and returns a list of all the <code><a href="/?query=%28%28name%3A%28%21Just%29%20package%3A%28%21basic-prelude%29%20module%3A%28%21CorePrelude%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Just%29%20package%3A%28%21basic-prelude%29%29%5E10.0%29%20OR%20name%3A%28%21Just%29">Just</a></code> values. </p>

fay-base -Data.Maybe  

<p>The <code><a href="/?query=%28%28name%3A%28%21catMaybes%29%20package%3A%28%21fay-base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21catMaybes%29%20package%3A%28%21fay-base%29%29%5E10.0%29%20OR%20name%3A%28%21catMaybes%29">catMaybes</a></code> function takes a list of <code><a href="/?query=%28%28name%3A%28%21Maybe%29%20package%3A%28%21fay-base%29%20module%3A%28%21Prelude%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Maybe%29%20package%3A%28%21fay-base%29%29%5E10.0%29%20OR%20name%3A%28%21Maybe%29">Maybe</a></code>s and returns a list of all the <code><a href="/?query=%28%28name%3A%28%21Just%29%20package%3A%28%21fay-base%29%20module%3A%28%21Prelude%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Just%29%20package%3A%28%21fay-base%29%29%5E10.0%29%20OR%20name%3A%28%21Just%29">Just</a></code> values.</p>

haskell2010 -Data.Maybe  

<p>The <code><a href="/?query=%28%28name%3A%28%21catMaybes%29%20package%3A%28%21haskell2010%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21catMaybes%29%20package%3A%28%21haskell2010%29%29%5E10.0%29%20OR%20name%3A%28%21catMaybes%29">catMaybes</a></code> function takes a list of <code><a href="/?query=%28%28name%3A%28%21Maybe%29%20package%3A%28%21haskell2010%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Maybe%29%20package%3A%28%21haskell2010%29%29%5E10.0%29%20OR%20name%3A%28%21Maybe%29">Maybe</a></code>s and returns a list of all the <code><a href="/?query=%28%28name%3A%28%21Just%29%20package%3A%28%21haskell2010%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Just%29%20package%3A%28%21haskell2010%29%29%5E10.0%29%20OR%20name%3A%28%21Just%29">Just</a></code> values. </p>

base -Data.Maybe  

<p>The <code><a href="/?query=%28%28name%3A%28%21mapMaybe%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21mapMaybe%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21mapMaybe%29">mapMaybe</a></code> function is a version of <code><a href="/?query=%28%28name%3A%28%21map%29%20package%3A%28%21base%29%20module%3A%28%21GHC.OldList%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21map%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21map%29">map</a></code> which can throw out elements. In particular, the functional argument returns something of type <code><code><a href="/?query=%28%28name%3A%28%21Maybe%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Maybe%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21Maybe%29">Maybe</a></code> b</code>. If this is <code><a href="/?query=%28%28name%3A%28%21Nothing%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Nothing%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21Nothing%29">Nothing</a></code>, no element is added on to the result list. If it is <code><code><a href="/?query=%28%28name%3A%28%21Just%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Just%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21Just%29">Just</a></code> b</code>, then <code>b</code> is included in the result list.</p><h4 id="control.ch:mapMaybe0" class="caption collapser" onclick="toggleSection('ch:mapMaybe0')">Examples</h4><div id="section.ch:mapMaybe0" class="hide"><p>Using <code><code><a href="/?query=%28%28name%3A%28%21mapMaybe%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21mapMaybe%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21mapMaybe%29">mapMaybe</a></code> f x</code> is a shortcut for <code><code><a href="/?query=%28%28name%3A%28%21catMaybes%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21catMaybes%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21catMaybes%29">catMaybes</a></code> $ <code><a href="/?query=%28%28name%3A%28%21map%29%20package%3A%28%21base%29%20module%3A%28%21GHC.OldList%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21map%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21map%29">map</a></code> f x</code> in most cases:</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>import Text.Read ( readMaybe ) </code></strong><code class="prompt">>>> </code><strong class="userinput"><code>let readMaybeInt = readMaybe :: String -> Maybe Int </code></strong><code class="prompt">>>> </code><strong class="userinput"><code>mapMaybe readMaybeInt ["1", "Foo", "3"] </code></strong>[1,3] <code class="prompt">>>> </code><strong class="userinput"><code>catMaybes $ map readMaybeInt ["1", "Foo", "3"] </code></strong>[1,3] </pre><p>If we map the <code><a href="/?query=%28%28name%3A%28%21Just%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Just%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21Just%29">Just</a></code> constructor, the entire list should be returned:</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>mapMaybe Just [1,2,3] </code></strong>[1,2,3] </pre></div>
catMaybesR :: C time => T time (Maybe body) -> T time body

event-list -Data.EventList.Relative.TimeTime  

<p>Adds times in a right-associative fashion. Use this if the time is a data type like lazy Peano numbers or <a href="/?query=%28%28name%3A%28%21Numeric.NonNegative.Chunky%29%20package%3A%28%21non-negative%29%20module%3A%28%21Numeric.NonNegative.Chunky%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Numeric.NonNegative.Chunky%29%20package%3A%28%21non-negative%29%29%5E10.0%29%20OR%20name%3A%28%21Numeric.NonNegative.Chunky%29">Numeric.NonNegative.Chunky</a>.</p>
catMaybes :: DSignal era (Maybe val) -> DSignal era val

grapefruit-frp -FRP.Grapefruit.Signal.Discrete  

<p>Converts all occurences with values of the form <code>Just <em>val</em></code> into occurences with value <code><em>val</em></code> and drops all occurences with value <code>Nothing</code>. </p>

strict-base-types -Data.Maybe.Strict  

<p>Analogous to <code><a href="/?query=%28%28name%3A%28%21catMaybes%29%20package%3A%28%21strict-base-types%29%20module%3A%28%21L%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21catMaybes%29%20package%3A%28%21strict-base-types%29%29%5E10.0%29%20OR%20name%3A%28%21catMaybes%29">catMaybes</a></code> in <a href="/?query=%28%28name%3A%28%21Data.Maybe%29%20package%3A%28%21base%29%20module%3A%28%21Data.Maybe%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Data.Maybe%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21Data.Maybe%29">Data.Maybe</a>. </p>