-
Notifications
You must be signed in to change notification settings - Fork 0
/
Eta-Types-Maybe.html
34 lines (34 loc) · 32.8 KB
/
Eta-Types-Maybe.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Eta.Types.Maybe</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Eta-Types-Maybe.html");};
//]]>
</script></head><body class="no-frame"><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption empty"> </p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>Safe</td></tr></table><p class="caption">Eta.Types.Maybe</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>The <code><a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a></code> type encapsulates an <strong>optional</strong>
value.</p><p>It either contains a value, represented by <code><a href="Eta-Types-Maybe.html#v:Just">Just</a></code> <code>a</code>,
or not, represented by <code><a href="Eta-Types-Maybe.html#v:Nothing">Nothing</a></code>.</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:Maybe">Maybe</a> a :: * -> *<ul class="subs"><li>= <a href="#v:Nothing">Nothing</a></li><li>| <a href="#v:Just">Just</a> a</li></ul></li><li class="src short"><a href="#v:isJust">isJust</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isNothing">isNothing</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:unsafeGetValue">unsafeGetValue</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> a</li><li class="src short"><a href="#v:getOrElse">getOrElse</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> a -> a</li><li class="src short"><a href="#v:handleMaybe">handleMaybe</a> :: b -> (a -> b) -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> b</li><li class="src short"><a href="#v:onlyJustValues">onlyJustValues</a> :: [<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a] -> [a]</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Maybe" class="def">Maybe</a> a :: * -> * <a href="#t:Maybe" class="selflink">#</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Nothing" class="def">Nothing</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a id="v:Just" class="def">Just</a> a</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:Maybe" class="caption collapser" onclick="toggleSection('i:Maybe')">Instances</p><div id="section.i:Maybe" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Monad:1" class="instance expander" onclick="toggleSection('i:id:Maybe:Monad:1')"></span> <a href="Eta-Classes-Monad.html#t:Monad">Monad</a> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Monad:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-62--62--61-">(>>=)</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> (a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> b) -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> b <a href="#v:-62--62--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62--62-">(>>)</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> b -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> b</p><p class="src"><a href="#v:return">return</a> :: a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a</p><p class="src"><a href="#v:fail">fail</a> :: <a href="Eta-Types-String.html#t:String">String</a> -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Functor:2" class="instance expander" onclick="toggleSection('i:id:Maybe:Functor:2')"></span> <a href="Eta-Classes-Functor.html#t:Functor">Functor</a> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Functor:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:fmap">fmap</a> :: (a -> b) -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> b <a href="#v:fmap" class="selflink">#</a></p><p class="src"><a href="#v:-60--36-">(<$)</a> :: a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> b -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Applicative:3" class="instance expander" onclick="toggleSection('i:id:Maybe:Applicative:3')"></span> <a href="Eta-Classes-Applicative.html#t:Applicative">Applicative</a> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Applicative:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pure">pure</a> :: a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a <a href="#v:pure" class="selflink">#</a></p><p class="src"><a href="#v:-60--42--62-">(<*>)</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> (a -> b) -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> b <a href="#v:-60--42--62-" class="selflink">#</a></p><p class="src"><a href="#v:-42--62-">(*>)</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> b -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> b</p><p class="src"><a href="#v:-60--42-">(<*)</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> b -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Foldable:4" class="instance expander" onclick="toggleSection('i:id:Maybe:Foldable:4')"></span> <a href="Eta-Classes-Foldable.html#t:Foldable">Foldable</a> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Foldable:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:fold">fold</a> :: <a href="Eta-Classes-Monoid.html#t:Monoid">Monoid</a> m => <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> m -> m</p><p class="src"><a href="#v:foldMap">foldMap</a> :: <a href="Eta-Classes-Monoid.html#t:Monoid">Monoid</a> m => (a -> m) -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> m <a href="#v:foldMap" class="selflink">#</a></p><p class="src"><a href="#v:foldr">foldr</a> :: (a -> b -> b) -> b -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> b <a href="#v:foldr" class="selflink">#</a></p><p class="src"><a href="#v:foldr-39-">foldr'</a> :: (a -> b -> b) -> b -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> b</p><p class="src"><a href="#v:foldl">foldl</a> :: (b -> a -> b) -> b -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> b</p><p class="src"><a href="#v:foldl-39-">foldl'</a> :: (b -> a -> b) -> b -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> b</p><p class="src"><a href="#v:foldr1">foldr1</a> :: (a -> a -> a) -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> a</p><p class="src"><a href="#v:foldl1">foldl1</a> :: (a -> a -> a) -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> a</p><p class="src"><a href="#v:toList">toList</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> [a]</p><p class="src"><a href="#v:null">null</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Bool.html#t:Bool">Bool</a></p><p class="src"><a href="#v:length">length</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types.html#t:Int">Int</a></p><p class="src"><a href="#v:elem">elem</a> :: <a href="Eta-Classes-Eq.html#t:Eq">Eq</a> a => a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Bool.html#t:Bool">Bool</a></p><p class="src"><a href="#v:maximum">maximum</a> :: <a href="Eta-Classes-Ord.html#t:Ord">Ord</a> a => <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> a</p><p class="src"><a href="#v:minimum">minimum</a> :: <a href="Eta-Classes-Ord.html#t:Ord">Ord</a> a => <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> a</p><p class="src"><a href="#v:sum">sum</a> :: <a href="Eta-Classes-Num.html#t:Num">Num</a> a => <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> a</p><p class="src"><a href="#v:product">product</a> :: <a href="Eta-Classes-Num.html#t:Num">Num</a> a => <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> a</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Traversable:5" class="instance expander" onclick="toggleSection('i:id:Maybe:Traversable:5')"></span> <a href="Eta-Classes-Traversable.html#t:Traversable">Traversable</a> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Traversable:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:traverse">traverse</a> :: <a href="Eta-Classes-Applicative.html#t:Applicative">Applicative</a> f => (a -> f b) -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> f (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> b) <a href="#v:traverse" class="selflink">#</a></p><p class="src"><a href="#v:sequenceA">sequenceA</a> :: <a href="Eta-Classes-Applicative.html#t:Applicative">Applicative</a> f => <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> (f a) -> f (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) <a href="#v:sequenceA" class="selflink">#</a></p><p class="src"><a href="#v:mapM">mapM</a> :: <a href="Eta-Classes-Monad.html#t:Monad">Monad</a> m => (a -> m b) -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> m (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> b)</p><p class="src"><a href="#v:sequence">sequence</a> :: <a href="Eta-Classes-Monad.html#t:Monad">Monad</a> m => <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> (m a) -> m (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Generic1:6" class="instance expander" onclick="toggleSection('i:id:Maybe:Generic1:6')"></span> Generic1 <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Generic1:6" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> Rep1 (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> :: * -> *) :: * -> *</p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:from1">from1</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> Rep1 <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a</p><p class="src"><a href="#v:to1">to1</a> :: Rep1 <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:MonadPlus:7" class="instance expander" onclick="toggleSection('i:id:Maybe:MonadPlus:7')"></span> MonadPlus <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:MonadPlus:7" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mzero">mzero</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a</p><p class="src"><a href="#v:mplus">mplus</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Alternative:8" class="instance expander" onclick="toggleSection('i:id:Maybe:Alternative:8')"></span> <a href="Eta-Classes-Alternative.html#t:Alternative">Alternative</a> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Alternative:8" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:empty">empty</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a <a href="#v:empty" class="selflink">#</a></p><p class="src"><a href="#v:-60--124--62-">(<|>)</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a <a href="#v:-60--124--62-" class="selflink">#</a></p><p class="src"><a href="#v:some">some</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> [a] <a href="#v:some" class="selflink">#</a></p><p class="src"><a href="#v:many">many</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> [a] <a href="#v:many" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Eq:9" class="instance expander" onclick="toggleSection('i:id:Maybe:Eq:9')"></span> <a href="Eta-Classes-Eq.html#t:Eq">Eq</a> a => <a href="Eta-Classes-Eq.html#t:Eq">Eq</a> (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Eq:9" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Ord:10" class="instance expander" onclick="toggleSection('i:id:Maybe:Ord:10')"></span> <a href="Eta-Classes-Ord.html#t:Ord">Ord</a> a => <a href="Eta-Classes-Ord.html#t:Ord">Ord</a> (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Ord:10" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:compare">compare</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Classes-Ord.html#t:Ordering">Ordering</a> <a href="#v:compare" class="selflink">#</a></p><p class="src"><a href="#v:-60-">(<)</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Bool.html#t:Bool">Bool</a> <a href="#v:-60-" class="selflink">#</a></p><p class="src"><a href="#v:-60--61-">(<=)</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Bool.html#t:Bool">Bool</a> <a href="#v:-60--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62-">(>)</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Bool.html#t:Bool">Bool</a> <a href="#v:-62-" class="selflink">#</a></p><p class="src"><a href="#v:-62--61-">(>=)</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Bool.html#t:Bool">Bool</a> <a href="#v:-62--61-" class="selflink">#</a></p><p class="src"><a href="#v:max">max</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a <a href="#v:max" class="selflink">#</a></p><p class="src"><a href="#v:min">min</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a <a href="#v:min" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Read:11" class="instance expander" onclick="toggleSection('i:id:Maybe:Read:11')"></span> <a href="Eta-Classes-Read.html#t:Read">Read</a> a => <a href="Eta-Classes-Read.html#t:Read">Read</a> (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Read:11" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:readsPrec">readsPrec</a> :: <a href="Eta-Types.html#t:Int">Int</a> -> ReadS (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) <a href="#v:readsPrec" class="selflink">#</a></p><p class="src"><a href="#v:readList">readList</a> :: ReadS [<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a]</p><p class="src"><a href="#v:readPrec">readPrec</a> :: ReadPrec (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)</p><p class="src"><a href="#v:readListPrec">readListPrec</a> :: ReadPrec [<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a]</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Show:12" class="instance expander" onclick="toggleSection('i:id:Maybe:Show:12')"></span> <a href="Eta-Classes-Show.html#t:Show">Show</a> a => <a href="Eta-Classes-Show.html#t:Show">Show</a> (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Show:12" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="Eta-Types.html#t:Int">Int</a> -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> ShowS <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a] -> ShowS <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Generic:13" class="instance expander" onclick="toggleSection('i:id:Maybe:Generic:13')"></span> Generic (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Generic:13" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> Rep (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) :: * -> *</p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:from">from</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> Rep (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) x</p><p class="src"><a href="#v:to">to</a> :: Rep (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) x -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Monoid:14" class="instance expander" onclick="toggleSection('i:id:Maybe:Monoid:14')"></span> <a href="Eta-Classes-Monoid.html#t:Monoid">Monoid</a> a => <a href="Eta-Classes-Monoid.html#t:Monoid">Monoid</a> (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Monoid:14" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mempty">mempty</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a <a href="#v:mempty" class="selflink">#</a></p><p class="src"><a href="#v:mappend">mappend</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a <a href="#v:mappend" class="selflink">#</a></p><p class="src"><a href="#v:mconcat">mconcat</a> :: [<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a] -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a <a href="#v:mconcat" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:SingKind:15" class="instance expander" onclick="toggleSection('i:id:Maybe:SingKind:15')"></span> SingKind a (KProxy a) => SingKind (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) (KProxy (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a))</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:SingKind:15" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> DemoteRep (KProxy (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)) (kparam :: KProxy (KProxy (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a))) :: *</p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:fromSing">fromSing</a> :: Sing (KProxy (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)) a -> DemoteRep (KProxy (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)) kparam</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:SingI:16" class="instance expander" onclick="toggleSection('i:id:Maybe:SingI:16')"></span> SingI (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) (<a href="Eta-Types-Maybe.html#v:Nothing">Nothing</a> a)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:SingI:16" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:sing">sing</a> :: Sing (<a href="Eta-Types-Maybe.html#v:Nothing">Nothing</a> a) a</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:SingI:17" class="instance expander" onclick="toggleSection('i:id:Maybe:SingI:17')"></span> SingI a a1 => SingI (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) (<a href="Eta-Types-Maybe.html#v:Just">Just</a> a a1)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:SingI:17" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:sing">sing</a> :: Sing (<a href="Eta-Types-Maybe.html#v:Just">Just</a> a a1) a</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Rep1:18" class="instance expander" onclick="toggleSection('i:id:Maybe:Rep1:18')"></span> <span class="keyword">type</span> Rep1 <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Rep1:18" class="inst-details hide"><div class="src"><span class="keyword">type</span> Rep1 <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> = D1 (MetaData "Maybe" "GHC.Base" "base" <a href="Eta-Types-Bool.html#v:False">False</a>) ((:+:) (C1 (MetaCons "Nothing" PrefixI <a href="Eta-Types-Bool.html#v:False">False</a>) U1) (C1 (MetaCons "Just" PrefixI <a href="Eta-Types-Bool.html#v:False">False</a>) (S1 (MetaSel (<a href="Eta-Types-Maybe.html#v:Nothing">Nothing</a> Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1)))</div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Rep:19" class="instance expander" onclick="toggleSection('i:id:Maybe:Rep:19')"></span> <span class="keyword">type</span> Rep (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Rep:19" class="inst-details hide"><div class="src"><span class="keyword">type</span> Rep (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) = D1 (MetaData "Maybe" "GHC.Base" "base" <a href="Eta-Types-Bool.html#v:False">False</a>) ((:+:) (C1 (MetaCons "Nothing" PrefixI <a href="Eta-Types-Bool.html#v:False">False</a>) U1) (C1 (MetaCons "Just" PrefixI <a href="Eta-Types-Bool.html#v:False">False</a>) (S1 (MetaSel (<a href="Eta-Types-Maybe.html#v:Nothing">Nothing</a> Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))))</div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:Sing:20" class="instance expander" onclick="toggleSection('i:id:Maybe:Sing:20')"></span> <span class="keyword">data</span> Sing (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:Sing:20" class="inst-details hide"><div class="src"><span class="keyword">data</span> Sing (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) <span class="keyword">where</span><ul class="inst"><li class="inst"><a id="v:SNothing" class="def">SNothing</a> :: Sing (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) (<a href="Eta-Types-Maybe.html#v:Nothing">Nothing</a> a)</li><li class="inst"><a id="v:SJust" class="def">SJust</a> :: Sing (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) (<a href="Eta-Types-Maybe.html#v:Just">Just</a> a a1)</li></ul></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:-61--61-:21" class="instance expander" onclick="toggleSection('i:id:Maybe:-61--61-:21')"></span> <span class="keyword">type</span> (==) (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> k) a b</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:-61--61-:21" class="inst-details hide"><div class="src"><span class="keyword">type</span> (==) (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> k) a b = EqMaybe k a b</div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Maybe:DemoteRep:22" class="instance expander" onclick="toggleSection('i:id:Maybe:DemoteRep:22')"></span> <span class="keyword">type</span> DemoteRep (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) (KProxy (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a))</span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Maybe:DemoteRep:22" class="inst-details hide"><div class="src"><span class="keyword">type</span> DemoteRep (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a) (KProxy (<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a)) = <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> (DemoteRep a (KProxy a))</div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:isJust" class="def">isJust</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Bool.html#t:Bool">Bool</a> <a href="#v:isJust" class="selflink">#</a></p></div><div class="doc"><p>Returns <code><a href="Eta-Types-Bool.html#v:True">True</a></code> if the Maybe is a Just</p></div><div class="top"><p class="src"><a id="v:isNothing" class="def">isNothing</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Eta-Types-Bool.html#t:Bool">Bool</a> <a href="#v:isNothing" class="selflink">#</a></p></div><div class="doc"><p>Returns <code><a href="Eta-Types-Bool.html#v:True">True</a></code> if the Maybe is a Nothing</p></div><div class="doc"><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>import Eta.Classes.Show
</code></strong><code class="prompt">>>> </code><strong class="userinput"><code>import Eta.Classes.Monoid
</code></strong></pre></div><div class="top"><p class="src"><a id="v:unsafeGetValue" class="def">unsafeGetValue</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> a <a href="#v:unsafeGetValue" class="selflink">#</a></p><div class="doc"><div class="warning"><p>Warning: Partial functions should be avoided.</p></div><p>Extracts the element out of a <code><a href="Eta-Types-Maybe.html#v:Just">Just</a></code>.
Throws an error if it is <code><a href="Eta-Types-Maybe.html#v:Nothing">Nothing</a></code></p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>unsafeGetValue (Just 1)
</code></strong>1
</pre></div></div><div class="top"><p class="src"><a id="v:getOrElse" class="def">getOrElse</a> :: <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> a -> a <a href="#v:getOrElse" class="selflink">#</a></p><div class="doc"><p>Takes a default value and a
<code><a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a></code> value. If the Maybe is <code><a href="Eta-Types-Maybe.html#v:Nothing">Nothing</a></code>,
it returns the default value, returns the
contents of the Maybe</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>x = Just "Something"
</code></strong><code class="prompt">>>> </code><strong class="userinput"><code>x `getOrElse` "Nothing found!"
</code></strong>"Something"
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>y = Nothing
</code></strong><code class="prompt">>>> </code><strong class="userinput"><code>y `getOrElse` "Nothing found!"
</code></strong>"Nothing found!"
</pre></div></div><div class="top"><p class="src"><a id="v:handleMaybe" class="def">handleMaybe</a> :: b -> (a -> b) -> <a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a -> b <a href="#v:handleMaybe" class="selflink">#</a></p><div class="doc"><p>Handler for the <code><a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a></code> type
Takes a default value, a function and a
<code><a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a></code> value. If the Maybe is <code><a href="Eta-Types-Maybe.html#v:Nothing">Nothing</a></code>,
it returns the default value, otherwise,
it maps the function and returns the
result</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>myMaybe = Just 42
</code></strong><code class="prompt">>>> </code><strong class="userinput"><code>handleMaybe "Nothing found" (\x -> "Got: " <+> show x) myMaybe
</code></strong>"Got: 42"
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>myMaybe' = Nothing
</code></strong><code class="prompt">>>> </code><strong class="userinput"><code>handleMaybe "Nothing found" (\x -> "Got: " <+> show x) myMaybe'
</code></strong>"Nothing found"
</pre></div></div><div class="top"><p class="src"><a id="v:onlyJustValues" class="def">onlyJustValues</a> :: [<a href="Eta-Types-Maybe.html#t:Maybe">Maybe</a> a] -> [a] <a href="#v:onlyJustValues" class="selflink">#</a></p><div class="doc"><p>Discards all <code><a href="Eta-Types-Maybe.html#v:Nothing">Nothing</a></code>s from the list,
returning all values</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>onlyJustValues [Just 1, Nothing, Just 2]
</code></strong>[1,2]
</pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.4</p></div></body></html>