<img style="border: none; background:none;" src="https://welovepg.polymail.io/v2/z/a/NTcwNDFlOTM4Njcx/4MfeLRqw9nt-IpxlBh8Lc87dd1Mqi7xhDHJqZqkEKFRZTd2xZcWrMNc_RBeUuqcQ-zLP8vXDzJ6-ZItz_JUVS2vTinZ8mE_XRSaclG9GcR1KtuKYuM_zmJftVlwOerfVfIUDKRyUTAdRXaQEPS5os0tYZA==.png" alt="" width="0px" height="0px" border="0" /><div style="widows: 1;">The regex-compat docs say "<span style="font-family: sans-serif; font-size: 13px; line-height: 18.2px; widows: 1; background-color: rgb(255, 255, 255);">Returns: </span><code style="margin: 0px; padding: 0px; line-height: 16.12px; font-size: 13px; widows: 1; background-color: rgb(255, 255, 255);"><code style="margin: 0px; padding: 0px; line-height: 16.12px;"><a href="https://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/Data-Maybe.html#v:Just" style="margin: 0px; padding: 0px; text-decoration: none; color: rgb(171, 105, 84);">Just</a></code> strs</code><span style="font-family: sans-serif; font-size: 13px; line-height: 18.2px; widows: 1; background-color: rgb(255, 255, 255);"> if the match succeeded (and </span><code style="margin: 0px; padding: 0px; line-height: 16.12px; font-size: 13px; widows: 1; background-color: rgb(255, 255, 255);">strs</code><span style="font-family: sans-serif; font-size: 13px; line-height: 18.2px; widows: 1; background-color: rgb(255, 255, 255);"> is the list of subexpression matches), or </span><code style="margin: 0px; padding: 0px; line-height: 16.12px; font-size: 13px; widows: 1; background-color: rgb(255, 255, 255);"><a href="https://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/Data-Maybe.html#v:Nothing" style="margin: 0px; padding: 0px; text-decoration: none; color: rgb(171, 105, 84);">Nothing</a></code><span style="font-family: sans-serif; font-size: 13px; line-height: 18.2px; widows: 1; background-color: rgb(255, 255, 255);"> otherwise.</span><span style="widows: 1; background-color: rgb(255, 255, 255); font-size: 13px; line-height: 18.200000762939453px;"><font face="sans-serif">”</font></span><span style="font-family: sans-serif; font-size: 13px; line-height: 18.2px; widows: 1; background-color: rgb(255, 255, 255);">.</span></div><br><div id="psignature"><div>Adam Bergmark</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">On Tue 05 Apr 2016 at 22:16 Jeffrey Brown <jeffbrown.the@gmail.com> <<a href="mailto:Jeffrey Brown <jeffbrown.the@gmail.com>">Jeffrey Brown <jeffbrown.the@gmail.com></a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Esteemed Haskellers,</div><div><br></div><div>It is working for me, but I am puzzled by the matchRegex function:</div><div><br></div><div> > import Text.Regex</div><div> > :i matchRegex</div><div> matchRegex :: Regex -> String -> Maybe [String]</div><div> -- Defined in ‘Text.Regex’</div><div><br></div><div>Searches that fail return Nothing:</div><div><br></div><div> > matchRegex (mkRegex "z") "abracadabra"</div><div> Nothing</div><div><br></div><div>which makes sense. But why do searches that succeed return an empty list of Strings?</div><div><br></div><div> > matchRegex (mkRegex "a") "abracadabra"</div><div> Just []</div><div> > </div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Jeffrey Benjamin Brown</div></div>
</div>
<p>_______________________________________________
<br>Haskell-Cafe mailing list
<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a>
<br><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
<br></p></blockquote></div><br></div>