Skip to content
New issue

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

Pass children to order function in treeSplice #2

Merged
merged 1 commit into from
Dec 27, 2022

Conversation

jfpedroza
Copy link
Contributor

Passes the children of a node to the sorter in Heist.Extra.Splices.Tree.treeSplice to be able to put folders first.

Comment on lines -25 to +26
flip foldMapM (sortOn (sortKey . extendPars . rootLabel) trees) $ \(Node lbl children) -> do
let sorter x = sortKey (extendPars $ rootLabel x) (subForest x)
flip foldMapM (sortOn sorter trees) $ \(Node lbl children) -> do
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let sortKey' = flip sortKey (subForest x)? Then the existing code would require minimal changes here, and below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But where would the x come from?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, right. Okay I'll review all your PRs by this weekend.

@srid
Copy link
Owner

srid commented Dec 27, 2022

bors try

bors bot added a commit that referenced this pull request Dec 27, 2022
@bors
Copy link

bors bot commented Dec 27, 2022

try

Build succeeded:

@srid srid merged commit 397bb20 into srid:master Dec 27, 2022
@srid
Copy link
Owner

srid commented Dec 27, 2022

@jfpedroza I wasn't able to push to this branch. Did you open the PR with "Allow repository author to make changes" (something of that ilk) option disabled?

@srid
Copy link
Owner

srid commented Dec 27, 2022

FYI: c5e6d86

@jfpedroza
Copy link
Contributor Author

I wasn't able to push to this branch. Did you open the PR with "Allow repository author to make changes" (something of that ilk) option disabled?

Apparently, I did. I must have disabled it without noticing.

@jfpedroza jfpedroza deleted the jp/tree-splice-sort-children branch December 27, 2022 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants