<div dir="ltr">Hi Sasa,<div><br></div><div>It might also help to look at the type of foldr:</div><div>foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b</div><div><br></div><div>The function go has type:</div><div>go :: Ord a => a -> (Maybe a, Bool) -> (Maybe a, Bool)</div><div><br></div><div>The tuple, initially (Nothing, True), will be passed to go as its *2nd* argument; the first argument will be an element of the list. The underscore, which means match anything and throw it away, is there because we don't care about any of the other elements once we know the list is not ordered.<br></div><div><br></div><div>Hope that helps,</div><div>vale</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>--<br>vale cofer-shabica<br>401.267.8253</div></div></div></div>
<br><div class="gmail_quote">On Mon, Jan 2, 2017 at 12:20 PM, Daniel Trstenjak <span dir="ltr"><<a href="mailto:daniel.trstenjak@gmail.com" target="_blank">daniel.trstenjak@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Sasa,<br>
<br>
> -- this confuses me, what is the _ here ? go is anonymous function, _ should stand for tuple ? and status xs from the top definition ?<br>
> go _ status@(_, False) = status<br>
<br>
The first argument of 'go' is '_', which means it's ignored.<br>
<br>
The second argument is 'status@(_, False)'.<br>
It's giving the tuple the name 'status' and pattern matching the tuple at once.<br>
<br>
If the pattern match succeeds, then the tuple named 'status' is returned by 'go'<br>
<br>
<br>
Greetings,<br>
Daniel<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br></div>