POV-Ray : Newsgroups : povray.off-topic : My first C++ program : Re: A test Server Time
30 Sep 2024 21:29:22 EDT (-0400)
  Re: A test  
From: Warp
Date: 23 Sep 2008 14:16:24
Message: <48d93277@news.povray.org>
Fredrik Eriksson <fe79}--at--{yahoo}--dot--{com> wrote:
> 'fold' (should probably be 'foldl1') is just a library function, not a  
> language primitive. The corresponding C++ library function is  
> 'std::accumulate'.

>    std::accumulate( my_list.begin(), my_list.end(), 0 );

  Which got me thinking: Does foldl1 in haskell work for data containers
other than lists? What if you want to apply it to only a sub-range inside
the data container rather than to the entire container? (Can you do it
without copying the sub-range to a separate container?)

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.