You find point I need the correct type signatures.<div>And seems like it is (missed IO in your description)</div><div><div>Kleisli IO FilePath [FilePath]</div><div><br></div><div>Thanks a lot!</div><div><br clear="all">-Haisheng<br>


<br><br><div class="gmail_quote">On Tue, Jun 28, 2011 at 12:38 AM, Ertugrul Soeylemez <span dir="ltr">&lt;<a href="mailto:es@ertes.de">es@ertes.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">Haisheng Wu &lt;<a href="mailto:freizl@gmail.com">freizl@gmail.com</a>&gt; wrote:<br>
<br>
&gt;   I&#39;m wondering if it is possible doing IO in terms of Arrow.<br>
&gt;   I got a function search all files under directory recursively and<br>
&gt; I&#39;d like to refartoring using Arrow terms.<br>
<br>
</div>Yes, it&#39;s possible using Kleisli, but it&#39;s not very convenient, because<br>
you need the Kleisli wrapper around everything.  Also usually there is<br>
really little reason to do that, because monads are more expressive.<br>
For example they allow you to encode computations with only outputs<br>
directly, without wrapping them in a computation, which takes a stub<br>
argument.<br>
<div class="im"><br>
<br>
&gt;   I tried to define a function like below but failed.<br>
&gt;   isDirExist = Kleisli doesDirectoryExist<br>
&gt;<br>
&gt;   Do I need to define a instance for IO to be Arrow? Or is there any<br>
&gt; existing solutions?<br>
<br>
</div>No, the needed instances are already there, but you need to change your<br>
type signatures:<br>
<br>
    myGetFilesInDir :: Kleisli FilePath [FilePath]<br>
<br>
<br>
Greets,<br>
Ertugrul<br>
<br>
<br>
--<br>
nightmare = unsafePerformIO (getWrongWife &gt;&gt;= sex)<br>
<a href="http://ertes.de/" target="_blank">http://ertes.de/</a><br>
<br>
<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</blockquote></div><br></div></div>