<br><div class="gmail_quote">On Wed, Feb 20, 2008 at 8:15 AM, Andrea Rossato &lt;<a href="mailto:andrea.rossato@unibz.it">andrea.rossato@unibz.it</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Wed, Feb 20, 2008 at 07:04:33AM -0500, Brent Yorgey wrote:<br>
&gt; Hmm... well, using &#39;catMaybes&#39; doesn&#39;t do that: catMaybes [Just &quot;abc&quot;,<br>
&gt; Nothing] --&gt; [&quot;abc&quot;], but catMaybes [Just &quot;abc&quot;, Just &quot;&quot;] --&gt; [&quot;abc&quot;, &quot;&quot;].<br>
&gt; But in the end I guess you&#39;re right, since the status bar output function<br>
&gt; filters out the empty string (in particular the &quot;sepBy&quot; function filters out<br>
&gt; the null string). &nbsp;I didn&#39;t realize this before, and I wonder whether it is<br>
&gt; really the correct behavior. &nbsp;My intention was to allow for two different<br>
&gt; cases, one in which a logger does not want to output anything (or gives an<br>
&gt; error), and another in which the logger explicitly wants to output the empty<br>
&gt; string. For example, maybe you have a logger which only outputs something<br>
&gt; some of the time, but when it is not outputting anything you still want a<br>
&gt; blank space where it would have been. &nbsp;I don&#39;t know, it&#39;s not really very<br>
&gt; important either way, I guess. =)<br>
<br>
<br>
</div>well, I was assuming a status bar is a one line only string and so a<br>
&quot;&quot; is... nothing...;)<br>
<br>
I see your point: someone wanted the prompt, afair, to return a Maybe<br>
String, where a Nothing was the user exiting the prompt with Esc or<br>
so. I don&#39;t think that could be the case of a logger, though.<br>
</blockquote><div><br>Yes, that was me. =)&nbsp; Anyway, the question here comes down to whether it&#39;s useful to be able to distinguish between failure and success returning the empty string.&nbsp; Even if we decide we don&#39;t care to distinguish between them right now (since empty strings will get filtered out anyway), on principle it still just seems sort of icky and non-Haskelly to me to signal failure with the special value &quot;&quot;.&nbsp; It reminds me of returning -1 from int functions in C. =P<br>
&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
BTW, it was Spencer who pushed me to reflect about the fact that a<br>
&#39;Maybe list&#39; is usually something uselessly complicated - I used a<br>
maybe [Window] or something like that in the very first version of the<br>
prompt if I recall it correctly...<br>
<div><div></div><div class="Wj3C7c"></div></div></blockquote><div><br>I think it depends on whether you are using a list to represent a &quot;list of successes&quot; (in which case Maybe [a] is not needed, since [] = no successes = failure), or to represent a singular data result (in which case the empty list is just as valid of a result as any other list, hence Maybe [a] is needed to denote possible failure).<br>
<br>-Brent<br></div></div>