docs/Mangrove/Result/Err.html in mangrove-0.12.0 vs docs/Mangrove/Result/Err.html in mangrove-0.14.0

- old
+ new

@@ -168,10 +168,76 @@ <li class="public "> <span class="summary_signature"> + <a href="#and-instance_method" title="#and (instance method)">#<strong>and</strong>(_other) &#x21d2; Result[T.type_parameter(:NewOkType), ErrType] </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#and_then-instance_method" title="#and_then (instance method)">#<strong>and_then</strong>(&amp;_block) &#x21d2; Result[T.type_parameter(:NewOkType), ErrType] </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#and_then_wt-instance_method" title="#and_then_wt (instance method)">#<strong>and_then_wt</strong>(_t_new_ok, &amp;_block) &#x21d2; Result[T.type_parameter(:NewOkType), ErrType] </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + <a href="#err%3F-instance_method" title="#err? (instance method)">#<strong>err?</strong> &#x21d2; Boolean </a> </span> @@ -280,10 +346,32 @@ <li class="public "> <span class="summary_signature"> + <a href="#map-instance_method" title="#map (instance method)">#<strong>map</strong>(&amp;block) &#x21d2; Result[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)] </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + <a href="#map_err-instance_method" title="#map_err (instance method)">#<strong>map_err</strong>(&amp;block) &#x21d2; Result[OkType, T.type_parameter(:NewErrType)] </a> </span> @@ -302,10 +390,32 @@ <li class="public "> <span class="summary_signature"> + <a href="#map_err_wt-instance_method" title="#map_err_wt (instance method)">#<strong>map_err_wt</strong>(_t_new_err, &amp;block) &#x21d2; Result[OkType, T.type_parameter(:NewErrType)] </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + <a href="#map_ok-instance_method" title="#map_ok (instance method)">#<strong>map_ok</strong>(&amp;_block) &#x21d2; Result[T.type_parameter(:NewOkType), ErrType] </a> </span> @@ -324,10 +434,56 @@ <li class="public "> <span class="summary_signature"> + <a href="#map_ok_wt-instance_method" title="#map_ok_wt (instance method)">#<strong>map_ok_wt</strong>(_t_new_ok, &amp;_block) &#x21d2; Result[T.type_parameter(:NewOkType), ErrType] </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Because sorbet deduct types from return values well.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#map_wt-instance_method" title="#map_wt (instance method)">#<strong>map_wt</strong>(_t_new_ok, _t_new_err, &amp;block) &#x21d2; Result[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)] </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + <a href="#ok%3F-instance_method" title="#ok? (instance method)">#<strong>ok?</strong> &#x21d2; Boolean </a> </span> @@ -346,10 +502,76 @@ <li class="public "> <span class="summary_signature"> + <a href="#or-instance_method" title="#or (instance method)">#<strong>or</strong>(other) &#x21d2; Result[OkType, ErrType] </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#or_else-instance_method" title="#or_else (instance method)">#<strong>or_else</strong>(&amp;block) &#x21d2; Result[OkType, T.type_parameter(:NewErrType)] </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#or_else_wt-instance_method" title="#or_else_wt (instance method)">#<strong>or_else_wt</strong>(_t_new_err, &amp;block) &#x21d2; Result[OkType, T.type_parameter(:NewErrType)] </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + <a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> &#x21d2; String </a> </span> @@ -403,11 +625,11 @@ <h3 class="inherited">Methods included from <span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Mangrove::Result</a></span></h3> - <p class="inherited"><span class='object_link'><a href="../Result.html#from_results-class_method" title="Mangrove::Result.from_results (method)">from_results</a></span></p> + <p class="inherited"><span class='object_link'><a href="../Result.html#err-class_method" title="Mangrove::Result.err (method)">err</a></span>, <span class='object_link'><a href="../Result.html#from_results-class_method" title="Mangrove::Result.from_results (method)">from_results</a></span>, <span class='object_link'><a href="../Result.html#ok-class_method" title="Mangrove::Result.ok (method)">ok</a></span></p> <div id="constructor_details" class="method_details_list"> @@ -450,16 +672,16 @@ <tr> <td> <pre class="lines"> -146 -147 -148</pre> +238 +239 +240</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 146</span> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 238</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_inner'>inner</span><span class='rparen'>)</span> <span class='ivar'>@inner</span> <span class='op'>=</span> <span class='id identifier rubyid_inner'>inner</span> <span class='kw'>end</span></pre> </td> @@ -524,23 +746,23 @@ <tr> <td> <pre class="lines"> -151 -152 -153 -154 -155 -156 -157 -158 -159 -160</pre> +243 +244 +245 +246 +247 +248 +249 +250 +251 +252</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 151</span> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 243</span> <span class='kw'>def</span> <span class='op'>==</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span> <span class='kw'>case</span> <span class='id identifier rubyid_other'>other</span> <span class='kw'>when</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ok.html" title="Mangrove::Result::Ok (class)">Ok</a></span></span> <span class='kw'>false</span> @@ -554,10 +776,222 @@ </tr> </table> </div> <div class="method_details "> + <h3 class="signature " id="and-instance_method"> + + #<strong>and</strong>(_other) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + + + </div> +</div> +<div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>_other</span> + + + <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]</tt>)</span> + + + + </li> + +</ul> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]</tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +312 +313 +314</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 312</span> + +<span class='kw'>def</span> <span class='kw'>and</span><span class='lparen'>(</span><span class='id identifier rubyid__other'>_other</span><span class='rparen'>)</span> + <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewOkType</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="and_then-instance_method"> + + #<strong>and_then</strong>(&amp;_block) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + + + </div> +</div> +<div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>_block</span> + + + <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>).returns(<span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>])</tt>)</span> + + + + </li> + +</ul> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]</tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +317 +318 +319</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 317</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_and_then'>and_then</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid__block'>_block</span><span class='rparen'>)</span> + <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewOkType</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="and_then_wt-instance_method"> + + #<strong>and_then_wt</strong>(_t_new_ok, &amp;_block) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + + + </div> +</div> +<div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>_t_new_ok</span> + + + <span class='type'>(<tt>T::Class[T.type_parameter(:NewOkType)]</tt>)</span> + + + + </li> + + <li> + + <span class='name'>_block</span> + + + <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>).returns(<span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>])</tt>)</span> + + + + </li> + +</ul> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]</tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +322 +323 +324</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 322</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_and_then_wt'>and_then_wt</span><span class='lparen'>(</span><span class='id identifier rubyid__t_new_ok'>_t_new_ok</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid__block'>_block</span><span class='rparen'>)</span> + <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewOkType</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> <h3 class="signature " id="err?-instance_method"> #<strong>err?</strong> &#x21d2; <tt>Boolean</tt> @@ -590,14 +1024,14 @@ <tr> <td> <pre class="lines"> -186</pre> +278</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 186</span> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 278</span> <span class='kw'>def</span> <span class='id identifier rubyid_err?'>err?</span> <span class='op'>=</span> <span class='kw'>true</span></pre> </td> </tr> </table> @@ -638,16 +1072,16 @@ <tr> <td> <pre class="lines"> -163 -164 -165</pre> +255 +256 +257</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 163</span> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 255</span> <span class='kw'>def</span> <span class='id identifier rubyid_err_inner'>err_inner</span> <span class='ivar'>@inner</span> <span class='kw'>end</span></pre> </td> @@ -718,16 +1152,16 @@ <tr> <td> <pre class="lines"> -173 -174 -175</pre> +265 +266 +267</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 173</span> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 265</span> <span class='kw'>def</span> <span class='id identifier rubyid_expect!'>expect!</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ControlSignal.html" title="Mangrove::Result::ControlSignal (class)">ControlSignal</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span> <span class='kw'>end</span></pre> </td> @@ -798,26 +1232,93 @@ <tr> <td> <pre class="lines"> -178 -179 -180</pre> +270 +271 +272</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 178</span> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 270</span> <span class='kw'>def</span> <span class='id identifier rubyid_expect_with!'>expect_with!</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ControlSignal.html" title="Mangrove::Result::ControlSignal (class)">ControlSignal</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> + <h3 class="signature " id="map-instance_method"> + + #<strong>map</strong>(&amp;block) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)]</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + + + </div> +</div> +<div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>block</span> + + + <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]).returns(<span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)])</tt>)</span> + + + + </li> + +</ul> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)]</tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +281 +282 +283</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 281</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> + <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> <h3 class="signature " id="map_err-instance_method"> #<strong>map_err</strong>(&amp;block) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt> @@ -837,11 +1338,11 @@ <li> <span class='name'>block</span> - <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>).returns(<span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)])</tt>)</span> + <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>).returns(T.type_parameter(:NewErrType))</tt>)</span> </li> @@ -865,26 +1366,104 @@ <tr> <td> <pre class="lines"> -194 -195 -196</pre> +302 +303 +304</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 194</span> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 302</span> <span class='kw'>def</span> <span class='id identifier rubyid_map_err'>map_err</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> - <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='ivar'>@inner</span><span class='rparen'>)</span> + <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span></span><span class='comma'>,</span> <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewErrType</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='ivar'>@inner</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> + <h3 class="signature " id="map_err_wt-instance_method"> + + #<strong>map_err_wt</strong>(_t_new_err, &amp;block) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + + + </div> +</div> +<div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>_t_new_err</span> + + + <span class='type'>(<tt>T::Class[T.type_parameter(:NewErrType)]</tt>)</span> + + + + </li> + + <li> + + <span class='name'>block</span> + + + <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>).returns(T.type_parameter(:NewErrType))</tt>)</span> + + + + </li> + +</ul> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +307 +308 +309</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 307</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_map_err_wt'>map_err_wt</span><span class='lparen'>(</span><span class='id identifier rubyid__t_new_err'>_t_new_err</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> + <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span></span><span class='comma'>,</span> <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewErrType</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='ivar'>@inner</span><span class='rparen'>)</span><span class='rparen'>)</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> <h3 class="signature " id="map_ok-instance_method"> #<strong>map_ok</strong>(&amp;_block) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]</tt> @@ -904,11 +1483,11 @@ <li> <span class='name'>_block</span> - <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>).returns(<span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>])</tt>)</span> + <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>).returns(T.type_parameter(:NewOkType))</tt>)</span> </li> @@ -932,26 +1511,195 @@ <tr> <td> <pre class="lines"> -189 -190 -191</pre> +291 +292 +293</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 189</span> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 291</span> <span class='kw'>def</span> <span class='id identifier rubyid_map_ok'>map_ok</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid__block'>_block</span><span class='rparen'>)</span> <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewOkType</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> + <h3 class="signature " id="map_ok_wt-instance_method"> + + #<strong>map_ok_wt</strong>(_t_new_ok, &amp;_block) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Because sorbet deduct types from return values well. This method takes a type of new inner values.</p> + + + </div> +</div> +<div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>_t_new_ok</span> + + + <span class='type'>(<tt>T::Class[T.type_parameter(:NewOkType)]</tt>)</span> + + + + </li> + + <li> + + <span class='name'>_block</span> + + + <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>).returns(T.type_parameter(:NewOkType))</tt>)</span> + + + + </li> + +</ul> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]</tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +297 +298 +299</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 297</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_map_ok_wt'>map_ok_wt</span><span class='lparen'>(</span><span class='id identifier rubyid__t_new_ok'>_t_new_ok</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid__block'>_block</span><span class='rparen'>)</span> + <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewOkType</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="map_wt-instance_method"> + + #<strong>map_wt</strong>(_t_new_ok, _t_new_err, &amp;block) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)]</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + + + </div> +</div> +<div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>_t_new_ok</span> + + + <span class='type'>(<tt>T.type_parameter(:NewOkType)</tt>)</span> + + + + </li> + + <li> + + <span class='name'>_t_new_err</span> + + + <span class='type'>(<tt>T.type_parameter(:NewErrType)</tt>)</span> + + + + </li> + + <li> + + <span class='name'>block</span> + + + <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]).returns(<span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)])</tt>)</span> + + + + </li> + +</ul> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)]</tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +286 +287 +288</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 286</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_map_wt'>map_wt</span><span class='lparen'>(</span><span class='id identifier rubyid__t_new_ok'>_t_new_ok</span><span class='comma'>,</span> <span class='id identifier rubyid__t_new_err'>_t_new_err</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> + <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> <h3 class="signature " id="ok?-instance_method"> #<strong>ok?</strong> &#x21d2; <tt>Boolean</tt> @@ -984,22 +1732,234 @@ <tr> <td> <pre class="lines"> -183</pre> +275</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 183</span> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 275</span> <span class='kw'>def</span> <span class='id identifier rubyid_ok?'>ok?</span> <span class='op'>=</span> <span class='kw'>false</span></pre> </td> </tr> </table> </div> <div class="method_details "> + <h3 class="signature " id="or-instance_method"> + + #<strong>or</strong>(other) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + + + </div> +</div> +<div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>other</span> + + + <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]</tt>)</span> + + + + </li> + +</ul> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>]</tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +327 +328 +329</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 327</span> + +<span class='kw'>def</span> <span class='kw'>or</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span> + <span class='id identifier rubyid_other'>other</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="or_else-instance_method"> + + #<strong>or_else</strong>(&amp;block) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + + + </div> +</div> +<div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>block</span> + + + <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>).returns(<span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)])</tt>)</span> + + + + </li> + +</ul> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +332 +333 +334</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 332</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_or_else'>or_else</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> + <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='ivar'>@inner</span><span class='rparen'>)</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="or_else_wt-instance_method"> + + #<strong>or_else_wt</strong>(_t_new_err, &amp;block) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + + + </div> +</div> +<div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>_t_new_err</span> + + + <span class='type'>(<tt>T::Class[T.type_parameter(:NewErrType)]</tt>)</span> + + + + </li> + + <li> + + <span class='name'>block</span> + + + <span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span>).returns(<span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)])</tt>)</span> + + + + </li> + +</ul> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +337 +338 +339</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 337</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_or_else_wt'>or_else_wt</span><span class='lparen'>(</span><span class='id identifier rubyid__t_new_err'>_t_new_err</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> + <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='ivar'>@inner</span><span class='rparen'>)</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> <h3 class="signature " id="to_s-instance_method"> #<strong>to_s</strong> &#x21d2; <tt>String</tt> @@ -1032,16 +1992,16 @@ <tr> <td> <pre class="lines"> -199 -200 -201</pre> +342 +343 +344</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 199</span> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 342</span> <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='kw'>super</span><span class='embexpr_end'>}</span><span class='tstring_content'>: inner=`</span><span class='embexpr_beg'>#{</span><span class='ivar'>@inner</span><span class='embexpr_end'>}</span><span class='tstring_content'>`</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>end</span></pre> </td> @@ -1097,16 +2057,16 @@ <tr> <td> <pre class="lines"> -168 -169 -170</pre> +260 +261 +262</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 168</span> + <pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 260</span> <span class='kw'>def</span> <span class='id identifier rubyid_unwrap!'>unwrap!</span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ControlSignal.html" title="Mangrove::Result::ControlSignal (class)">ControlSignal</a></span></span><span class='comma'>,</span> <span class='ivar'>@inner</span> <span class='kw'>end</span></pre> </td> @@ -1117,10 +2077,10 @@ </div> </div> <div id="footer"> - Generated on Tue Oct 24 20:44:49 2023 by + Generated on Thu Oct 26 12:34:24 2023 by <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> 0.9.34 (ruby-3.1.2). </div> </div> \ No newline at end of file