<p dir="ltr">Thanks Ertugrul. In the meantime I noticed that split and unsplit are also missing. Is there a similar replacement for them?</p>
<p dir="ltr">Adrian.<br>
</p>
<div class="gmail_quote">On 5 Jun 2013 12:57, "Ertugrul Söylemez" <<a href="mailto:es@ertes.de">es@ertes.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Adrian May <<a href="mailto:adrian.alexander.may@gmail.com">adrian.alexander.may@gmail.com</a>> wrote:<br>
<br>
> I just banged up against this problem:<br>
><br>
> <a href="http://haskell.1045720.n5.nabble.com/The-case-of-the-missing-Arrow-function-td3125388.html" target="_blank">http://haskell.1045720.n5.nabble.com/The-case-of-the-missing-Arrow-function-td3125388.html</a><br>
><br>
> Was liftA2 (not the applicative one) a bad idea, or is there another<br>
> way to do it, or what?<br>
<br>
That liftA2 (let me call it liftA2') likely has this type signature:<br>
<br>
liftA2' :: (Arrow cat)<br>
=> (b -> c -> d)<br>
-> cat a b<br>
-> cat a c<br>
-> cat a d<br>
<br>
Does this sound familiar? You can write this function in terms of the<br>
arrow combinators:<br>
<br>
liftA2' f c d = arr (uncurry f) . (c &&& d)<br>
<br>
However, if your arrow is also a family of applicative functors<br>
(i.e. pretty much always),<br>
<br>
instance Applicative (MyArrow a)<br>
<br>
then it's probably a bad idea, because you really want to use the<br>
cleaner liftA2 instead:<br>
<br>
liftA2 :: (Applicative f)<br>
=> (a -> b -> c)<br>
-> f a<br>
-> f b<br>
-> f c<br>
<br>
<br>
Greets,<br>
Ertugrul<br>
<br>
--<br>
Not to be or to be and (not to be or to be and (not to be or to be and<br>
(not to be or to be and ... that is the list monad.<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>
<br></blockquote></div>