We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$cmp = sub { ... }; # where $a/$b = [$k, $v] $oh->sort( $comparator );
Or should users just create sorted copies with clone and their own list of keys?
clone
If adding a sort, should it optionally take Schwartzian tranform arguments for efficiency/utility?
$oh->sort( $cmp, $xin, $xout );
Essentially, default $xin and $xout are these:
$xin
$xout
$xin = sub { [ $_, $_[0]->{$_} ] }; $xout = sub { $_->[0] };
Called like this:
@keys = map { $xout->($self) } sort $cmp map { $xin->($self) };
This might be a lot more complexity and indirection vs just using clone:
$oh = $oh->clone( map { ... } sort { ... } map { ... } $oh->keys );
So maybe not allowing custom $xin and $xout is best, but do a ST internally to [$k, $v] for a bit of flexibility in ordering.
[$k, $v]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Or should users just create sorted copies with
clone
andtheir own list of keys?
If adding a sort, should it optionally take Schwartzian
tranform arguments for efficiency/utility?
Essentially, default
$xin
and$xout
are these:Called like this:
This might be a lot more complexity and indirection vs just using clone:
So maybe not allowing custom $xin and $xout is best, but do a ST internally
to
[$k, $v]
for a bit of flexibility in ordering.The text was updated successfully, but these errors were encountered: