in reply to Re^4: short sorts
in thread short sorts
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$foo = $bar . $ram . $ewe;
(assuming all the argument types match up).f = g . h . i
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: short sorts
by topher (Scribe) on Apr 25, 2012 at 22:50 UTC | |
by Arunbear (Prior) on Apr 26, 2012 at 21:59 UTC | |
|
Re^6: short sorts
by Lady_Aleena (Priest) on Apr 10, 2012 at 02:02 UTC |