|
|
| There's more than one way to do things | |
| PerlMonks |
Re^5: short sortsby Arunbear (Vicar) |
| on Apr 07, 2012 at 15:37 UTC ( #963922=note: print w/ replies, xml ) | Need Help?? |
|
I've been trying to learn Haskell for greater good. It's a functional language, which (among other things) means functions are first class citizens: you can pass them as arguments to other functions, return them from functions, and easily combine them with other functions. e.g. whereas in Perl you can create a new string within Haskell you can create a new function with (assuming all the argument types match up). That's what the Compose function I wrote does. I thought of doing that after noticing how similar your various sort functions were, and how they could be built by composing/layering basic operations on top of one another. I'm not suggesting you write your code like that, I wrote it mainly out of curiosity to see what such a functional style would look like in Perl.
In Section
Cool Uses for Perl
|
|
||||||||||||||||||||||||||