in reply to More functional programming utilities
Your fold_left can be done exactly as you've written it using reduce. fold_right would require only one reverse. mult would be another reduce (as, internally, sum is). You could also do log math on sum. :-)use Algorithm::Loops 'MapCar'; my $wide = [[1,2,3],[2,3,5]]; my $tall = [ MapCar {[@_]} @$wide ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: More functional programming utilities
by kaif (Friar) on Jun 08, 2005 at 14:03 UTC | |
by Roy Johnson (Monsignor) on Jun 08, 2005 at 15:38 UTC | |
by kaif (Friar) on Jun 08, 2005 at 16:22 UTC | |
by demerphq (Chancellor) on Jun 08, 2005 at 18:44 UTC | |
by kaif (Friar) on Jun 09, 2005 at 01:28 UTC | |
|
Re^2: More functional programming utilities
by ivancho (Hermit) on Jun 08, 2005 at 11:42 UTC |