title: map/fold operators (in c++)
body: <p>I am writing <a href="http://volnitsky.com/project/ro/" rel="nofollow">library</a> which can do map/fold operations on ranges.  I need to do these with operators.  I am not very familiar with functional programming and I've tentatively selected <code>*</code> for map and <code>||</code> for fold.  So to find (brute force algorithm) maximum of  <code>cos(x)</code> in interval: <code>8 &lt; x &lt; 9</code>:</p>
  
  <pre><code>double maximum = ro::range(8, 9, 0.01) * std::cos  || std::max;
  </code></pre>
  
  <p>In above, <code>ro::range</code> can be replaced with any STL container. </p>
  
  <p>I don't want to be different if there is any convention for map/fold operators. My question is:  is there a math notation or does any language uses operators for map/fold?  </p>
  
  <p>** EDIT **</p>
  
  <p>For those who asked, below is small demo of what RO currently can do.  <code>scc</code> is small utility which can evaluate C++ snippets. </p>
  
  <pre><code>// Can print ranges, container, tuples, etc directly (vint is vector&lt;int&gt;) :
  scc 'vint V{1,2,3};  V'
  {1,2,3}
  
  // Classic pipe. Alogorithms are from std::
  scc 'vint{3,1,2,3} | sort | unique | reverse'
  {3, 2, 1}
  
  // Assign 42 to [2..5)
  scc 'vint V=range(0,9);   range(V/2, V/5) = 42;  V'
  {0, 1, 42, 42, 42, 5, 6, 7, 8, 9}
  
  
  // concatenate vector of strings ('add' is shotcut for std::plus&lt;T&gt;()):
  scc 'vstr V{"aaa", "bb", "cccc"};  V || add'
  aaabbcccc
  
  // Total length of strings in vector of strings
  scc 'vstr V{"aaa", "bb", "cccc"};  V * size ||  (_1+_2)'
  9
  
  // Assign to c-string, then append `"XYZ"` and then remove `"bc"` substring :
  scc 'char s[99];  range(s) = "abc";  (range(s) &lt;&lt; "XYZ") - "bc"'
  aXYZ
  
  
  // Remove non alpha-num characters and convert to upper case
  scc '(range("abc-123, xyz/") | isalnum) * toupper'
  ABC123XYZ
  
  
  // Hide phone number:
  scc "str S=\"John Q Public  (650)1234567\";  S|isdigit='X';  S"
  John Q Public  (XXX)XXXXXXX
  </code></pre>