| Anonymous | Login | Signup for a new account | 2013-05-20 06:06 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
| 0005236 | OCaml | OCaml general | public | 2011-03-07 23:20 | 2012-01-19 22:53 | |||||||
| Reporter | till | |||||||||||
| Assigned To | xclerc | |||||||||||
| Priority | normal | Severity | feature | Reproducibility | always | |||||||
| Status | resolved | Resolution | fixed | |||||||||
| Platform | OS | OS Version | ||||||||||
| Product Version | 3.12.0 | |||||||||||
| Target Version | Fixed in Version | 3.12.1+dev | ||||||||||
| Summary | 0005236: Add %revapply as a primitive (for infix pipe) | |||||||||||
| Description | One emerging idiom (at least in jane street's code base) is to define a pipe operator to string computations as such: let (|>) x f = f x This, sadly, does come with a performance hit (enough that we've actually seriously considered ). The attached patch introduces a new primitive (%revapply) that can be used to define |>: external (|>) : 'a -> ('a -> 'b) -> 'b = "%revapply" Feedback and comments would be greatly appreciated. | |||||||||||
| Tags | No tags attached. | |||||||||||
| Attached Files | ||||||||||||
Notes |
|
|
(0005840) dbuenzli (reporter) 2011-03-08 01:00 |
I also use this in various places in my code (it often shows up in combinator approaches). Can't comment on the performance hit though. |
|
(0005868) thelema (reporter) 2011-04-17 21:06 |
This solution, while workable, doesn't seem like the right way to do this. What about improving the inliner to inline function composition/application structures (like this and (fun f g x -> g (f x)), etc) in general? |
|
(0006740) lefessan (developer) 2012-01-19 22:06 |
I modified the fix (SVN commit r12055 in version/3.12): - it should now print correctly the location - non-unary functions are also optimized (before, they would be partially applied twice). |
|
(0006744) hcarty (reporter) 2012-01-19 22:53 |
Will this be included in trunk/3.13 as well? |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2011-03-07 23:20 | till | New Issue | |
| 2011-03-07 23:20 | till | File Added: revapply.patch | |
| 2011-03-08 01:00 | dbuenzli | Note Added: 0005840 | |
| 2011-04-17 21:06 | thelema | Note Added: 0005868 | |
| 2011-04-29 16:25 | doligez | Status | new => acknowledged |
| 2011-09-15 15:24 | xclerc | Status | acknowledged => resolved |
| 2011-09-15 15:24 | xclerc | Fixed in Version | => 3.12.1+dev |
| 2011-09-15 15:24 | xclerc | Resolution | open => fixed |
| 2011-09-15 15:24 | xclerc | Assigned To | => xclerc |
| 2012-01-19 22:06 | lefessan | Note Added: 0006740 | |
| 2012-01-19 22:53 | hcarty | Note Added: 0006744 | |
| Copyright © 2000 - 2011 MantisBT Group |