tag:blogger.com,1999:blog-8980149464912824496.post694480735197196076..comments2022-03-24T15:29:37.388-07:00Comments on TechNeilogy: Flip Operator for F#?TechNeilogyhttp://www.blogger.com/profile/06377881138289568562noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-8980149464912824496.post-47013788639046558132010-06-27T07:12:40.320-07:002010-06-27T07:12:40.320-07:00Thank you, Chris! One of my favorite things about...Thank you, Chris! One of my favorite things about F# is the way even small changes to operators (etc.) can make a real improvement in the readability of code. That is, they can make the code "look like what it does." I think it's maintenance factors like this that are helping to drive the acceptance of F#.TechNeilogyhttps://www.blogger.com/profile/06377881138289568562noreply@blogger.comtag:blogger.com,1999:blog-8980149464912824496.post-16297093148401293532010-06-27T03:55:51.649-07:002010-06-27T03:55:51.649-07:00This is neat, one of my annoyances is when trying ...This is neat, one of my annoyances is when trying to simplify (for example) filter operations, eg:<br />[1..100] |> List.filter ((>)50)<br /><br />Which counterintuitively returns all values which are less than 50, and the 50 applies to the other side of (>). So if I do:<br />[1.100] |> List.filter ((flip(>))50)<br /><br />I get the intuitive result of all values greater than 50. Nice - thanks Neil.Chris Ballardhttps://www.blogger.com/profile/14558028329429981215noreply@blogger.comtag:blogger.com,1999:blog-8980149464912824496.post-52137539883178385652010-06-25T12:24:17.404-07:002010-06-25T12:24:17.404-07:00Thanks for the comment, Ashley. To steal a phrase...Thanks for the comment, Ashley. To steal a phrase from the Lord of the Rings: "Even the smallest operator can change the course of the future."<br /><br />By the way, as someone who was first introduced to functional programming via LISP/Scheme, I really appreciate your FScheme series!TechNeilogyhttps://www.blogger.com/profile/06377881138289568562noreply@blogger.comtag:blogger.com,1999:blog-8980149464912824496.post-66018249334183601132010-06-25T10:54:32.512-07:002010-06-25T10:54:32.512-07:00True, 'flip' is standard in the Haskell pr...True, 'flip' is standard in the Haskell prelude. Strange that it's missing in F#. That and 'curry'/'uncurry'... Useful for point-free style, which I personally loveAshleyFhttp://blogs.msdn.com/ashleyfnoreply@blogger.com