The Missing Arrow Function Strikes Back

Hi All, I just banged up against this problem: http://haskell.1045720.n5.nabble.com/The-case-of-the-missing-Arrow-function-... Was liftA2 (not the applicative one) a bad idea, or is there another way to do it, or what? TIA, Adrian.

Adrian May
I just banged up against this problem:
http://haskell.1045720.n5.nabble.com/The-case-of-the-missing-Arrow-function-...
Was liftA2 (not the applicative one) a bad idea, or is there another way to do it, or what?
That liftA2 (let me call it liftA2') likely has this type signature: liftA2' :: (Arrow cat) => (b -> c -> d) -> cat a b -> cat a c -> cat a d Does this sound familiar? You can write this function in terms of the arrow combinators: liftA2' f c d = arr (uncurry f) . (c &&& d) However, if your arrow is also a family of applicative functors (i.e. pretty much always), instance Applicative (MyArrow a) then it's probably a bad idea, because you really want to use the cleaner liftA2 instead: liftA2 :: (Applicative f) => (a -> b -> c) -> f a -> f b -> f c Greets, Ertugrul -- Not to be or to be and (not to be or to be and (not to be or to be and (not to be or to be and ... that is the list monad.

Thanks Ertugrul. In the meantime I noticed that split and unsplit are also
missing. Is there a similar replacement for them?
Adrian.
On 5 Jun 2013 12:57, "Ertugrul Söylemez"
Adrian May
wrote: I just banged up against this problem:
http://haskell.1045720.n5.nabble.com/The-case-of-the-missing-Arrow-function-...
Was liftA2 (not the applicative one) a bad idea, or is there another way to do it, or what?
That liftA2 (let me call it liftA2') likely has this type signature:
liftA2' :: (Arrow cat) => (b -> c -> d) -> cat a b -> cat a c -> cat a d
Does this sound familiar? You can write this function in terms of the arrow combinators:
liftA2' f c d = arr (uncurry f) . (c &&& d)
However, if your arrow is also a family of applicative functors (i.e. pretty much always),
instance Applicative (MyArrow a)
then it's probably a bad idea, because you really want to use the cleaner liftA2 instead:
liftA2 :: (Applicative f) => (a -> b -> c) -> f a -> f b -> f c
Greets, Ertugrul
-- Not to be or to be and (not to be or to be and (not to be or to be and (not to be or to be and ... that is the list monad.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

What are the types of 'split' and 'unsplit'? It is hard to guess what you want just from their names. -Brent On Wed, Jun 05, 2013 at 01:02:40PM +0800, Adrian May wrote:
Thanks Ertugrul. In the meantime I noticed that split and unsplit are also missing. Is there a similar replacement for them?
Adrian. On 5 Jun 2013 12:57, "Ertugrul Söylemez"
wrote: Adrian May
wrote: I just banged up against this problem:
http://haskell.1045720.n5.nabble.com/The-case-of-the-missing-Arrow-function-...
Was liftA2 (not the applicative one) a bad idea, or is there another way to do it, or what?
That liftA2 (let me call it liftA2') likely has this type signature:
liftA2' :: (Arrow cat) => (b -> c -> d) -> cat a b -> cat a c -> cat a d
Does this sound familiar? You can write this function in terms of the arrow combinators:
liftA2' f c d = arr (uncurry f) . (c &&& d)
However, if your arrow is also a family of applicative functors (i.e. pretty much always),
instance Applicative (MyArrow a)
then it's probably a bad idea, because you really want to use the cleaner liftA2 instead:
liftA2 :: (Applicative f) => (a -> b -> c) -> f a -> f b -> f c
Greets, Ertugrul
-- Not to be or to be and (not to be or to be and (not to be or to be and (not to be or to be and ... that is the list monad.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Is there a tool like "make" or "ant" that's written in Haskell? I recall seeing something about a bit of software written in Haskell that does dependency-checking for builds. To be clear, I mean a tool that is generic in the sense that it would build anything, not just code written in Haskell. thanks, Kevin This message (including any attachments) is intended only for the use of the individual or entity to which it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute as attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if this is an electronic communication. Thank you.

Sounds like you're looking for Shake: http://community.haskell.org/~ndm/shake/ On Wednesday, June 5, 2013, Kelleher, Kevin wrote:
Is there a tool like "make" or "ant" that's written in Haskell?
I recall seeing something about a bit of software written in Haskell that does dependency-checking for builds.
To be clear, I mean a tool that is generic in the sense that it would build anything, not just code written in Haskell.
thanks,
Kevin This message (including any attachments) is intended only for the use of the individual or entity to which it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute as attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if this is an electronic communication.
Thank you.
_______________________________________________ Beginners mailing list Beginners@haskell.org javascript:; http://www.haskell.org/mailman/listinfo/beginners

Thanks to you and the others who pointed me there! Kevin From: beginners-bounces@haskell.org [mailto:beginners-bounces@haskell.org] On Behalf Of Bob Ippolito Sent: Wednesday, June 05, 2013 10:13 AM To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell Subject: Re: [Haskell-beginners] Haskell make/ant replacement? Sounds like you're looking for Shake: http://community.haskell.org/~ndm/shake/ On Wednesday, June 5, 2013, Kelleher, Kevin wrote: Is there a tool like "make" or "ant" that's written in Haskell? I recall seeing something about a bit of software written in Haskell that does dependency-checking for builds. To be clear, I mean a tool that is generic in the sense that it would build anything, not just code written in Haskell. thanks, Kevin This message (including any attachments) is intended only for the use of the individual or entity to which it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute as attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if this is an electronic communication. Thank you. _______________________________________________ Beginners mailing list Beginners@haskell.orgjavascript:; http://www.haskell.org/mailman/listinfo/beginners This message (including any attachments) is intended only for the use of the individual or entity to which it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute as attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if this is an electronic communication. Thank you.

Look up shake. It's awesome!
Ben
On 5 Jun 2013 15:11, "Kelleher, Kevin"
Is there a tool like "make" or "ant" that's written in Haskell?
I recall seeing something about a bit of software written in Haskell that does dependency-checking for builds.
To be clear, I mean a tool that is generic in the sense that it would build anything, not just code written in Haskell.
thanks,
Kevin This message (including any attachments) is intended only for the use of the individual or entity to which it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute as attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if this is an electronic communication.
Thank you.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Shake? http://hackage.haskell.org/package/shake
Regards,
- Lyndon
On Thu, Jun 6, 2013 at 12:08 AM, Kelleher, Kevin
Is there a tool like "make" or "ant" that's written in Haskell?
I recall seeing something about a bit of software written in Haskell that does dependency-checking for builds.
To be clear, I mean a tool that is generic in the sense that it would build anything, not just code written in Haskell.
thanks,
Kevin This message (including any attachments) is intended only for the use of the individual or entity to which it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute as attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if this is an electronic communication.
Thank you.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Well I just read this:
http://www.haskell.org/haskellwiki/Arrow_tutorial
Adrian.
On 5 June 2013 21:58, Brent Yorgey
What are the types of 'split' and 'unsplit'? It is hard to guess what you want just from their names.
-Brent
On Wed, Jun 05, 2013 at 01:02:40PM +0800, Adrian May wrote:
Thanks Ertugrul. In the meantime I noticed that split and unsplit are also missing. Is there a similar replacement for them?
Adrian. On 5 Jun 2013 12:57, "Ertugrul Söylemez"
wrote: Adrian May
wrote: I just banged up against this problem:
http://haskell.1045720.n5.nabble.com/The-case-of-the-missing-Arrow-function-...
Was liftA2 (not the applicative one) a bad idea, or is there another way to do it, or what?
That liftA2 (let me call it liftA2') likely has this type signature:
liftA2' :: (Arrow cat) => (b -> c -> d) -> cat a b -> cat a c -> cat a d
Does this sound familiar? You can write this function in terms of the arrow combinators:
liftA2' f c d = arr (uncurry f) . (c &&& d)
However, if your arrow is also a family of applicative functors (i.e. pretty much always),
instance Applicative (MyArrow a)
then it's probably a bad idea, because you really want to use the cleaner liftA2 instead:
liftA2 :: (Applicative f) => (a -> b -> c) -> f a -> f b -> f c
Greets, Ertugrul
-- Not to be or to be and (not to be or to be and (not to be or to be and (not to be or to be and ... that is the list monad.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Ah. Well, you can implement split and unsplit just as they are written on that page. You can even make split nicer by implementing it as split = id &&& id which avoids the use of 'arr'. However, I don't really see much practical point to 'split' (though it is nice theoretically). Usually, when you split something you follow it up by applying more arrows to both components of the tuple. But in that case you might as well just write (f &&& g) in the first place, instead of split >>> (f *** g). -Brent On Wed, Jun 05, 2013 at 10:46:10PM +0800, Adrian May wrote:
Well I just read this:
http://www.haskell.org/haskellwiki/Arrow_tutorial
Adrian.
On 5 June 2013 21:58, Brent Yorgey
wrote: What are the types of 'split' and 'unsplit'? It is hard to guess what you want just from their names.
-Brent
On Wed, Jun 05, 2013 at 01:02:40PM +0800, Adrian May wrote:
Thanks Ertugrul. In the meantime I noticed that split and unsplit are also missing. Is there a similar replacement for them?
Adrian. On 5 Jun 2013 12:57, "Ertugrul Söylemez"
wrote: Adrian May
wrote: I just banged up against this problem:
http://haskell.1045720.n5.nabble.com/The-case-of-the-missing-Arrow-function-...
Was liftA2 (not the applicative one) a bad idea, or is there another way to do it, or what?
That liftA2 (let me call it liftA2') likely has this type signature:
liftA2' :: (Arrow cat) => (b -> c -> d) -> cat a b -> cat a c -> cat a d
Does this sound familiar? You can write this function in terms of the arrow combinators:
liftA2' f c d = arr (uncurry f) . (c &&& d)
However, if your arrow is also a family of applicative functors (i.e. pretty much always),
instance Applicative (MyArrow a)
then it's probably a bad idea, because you really want to use the cleaner liftA2 instead:
liftA2 :: (Applicative f) => (a -> b -> c) -> f a -> f b -> f c
Greets, Ertugrul
-- Not to be or to be and (not to be or to be and (not to be or to be and (not to be or to be and ... that is the list monad.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (7)
-
Adrian May
-
Benjamin Edwards
-
Bob Ippolito
-
Brent Yorgey
-
Ertugrul Söylemez
-
Kelleher, Kevin
-
Lyndon Maydwell