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

Simplify dual #7

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Simplify dual #7

wants to merge 15 commits into from

Conversation

cchalmers
Copy link
Member

Don't merge yet. This is a rewrite of the DUAL tree structure.

Changes:

  • Now separated into DALTree and DUALTree. The DALTree is non-empty (except for an empty Concat) and does not contain any u annotations. The DUALTree is either EmptyDUAL or a u annotation with a DALTree. The structure is also mostly strict, I still need to play with things to see what gives the best performance.
  • Having the u annotation exclusively at the top simplifies things (lower u annotations where never used before anyway). Changes to the u no longer need to propagate does the whole tree.
  • Folding has been simplified a little by enforcing the result is a Monoid.
  • There's two variants for folding a dual tree: One is the simple version where all down annotations are pushed to the leafs. The primed version allows you to use "partial" down annotations that are reset between Concats. In diagrams this lets you apply, for example, a clipping to multiple diagrams at once.

The new representation is simpler and should preform faster. Still
untested.
This allows accumulation of 'partial' down annotations between concats.
On second thoughts these don't make sense in their derived form.
@jeffreyrosenbluth
Copy link
Member

I've given this and the related pull requests an initial read through and things look good to me. I do think we could use some more comments in the new code.

TypeOperators,
FlexibleContexts,
DeriveDataTypeable

Copy link
Member

Choose a reason for hiding this comment

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

Why did you remove the other-extensions?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't actually remember. I'll add it back.

Copy link
Member

Choose a reason for hiding this comment

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

OK. Of course the specific list of extensions used has probably changed.

@byorgey
Copy link
Member

byorgey commented Jul 14, 2015

Let me know what you think of the updated comments I just pushed.

@cchalmers
Copy link
Member Author

Comments look good.

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.

3 participants