[Haskell-beginners] Exercise of "Programming with Arrows"

Kim-Ee Yeoh ky3 at atamo.com
Wed Oct 16 18:16:33 UTC 2013


On Thu, Oct 17, 2013 at 12:41 AM, Thiago Negri <evohunz at gmail.com> wrote:

> The only hit I get in DuckDuckGo was this:
> http://sigkill.dk/programs/arrows/
>
> I've tried things like this, and I couldn't make it work.
> Yet I've copy&pasted the code, and it worked! Even with the "loop_bufid"
> test!
>

If it's any consolation, feed 'er this:

arrswap2 :: SP (a,b) (b,a)
arrswap2 = let r = Get(\(a1,b1) -> Get(\(a2,b2) -> Put (b1,a1) (Put (b2,a2)
r))) in r

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20131017/bdcbfdda/attachment.html>


More information about the Beginners mailing list