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

Refactor: rename AnnDiagram to QDiagram #15

Closed
fryguybob opened this issue Aug 4, 2012 · 2 comments
Closed

Refactor: rename AnnDiagram to QDiagram #15

fryguybob opened this issue Aug 4, 2012 · 2 comments

Comments

@fryguybob
Copy link
Member

(Imported from http://code.google.com/p/diagrams/issues/detail?id=56. Original issue from byor...@gmail.com on September 23, 2011, 10:58:07 PM UTC)

We now use the term "query", rather than "annotation", to refer to the function assigning monoidal values to points in a diagram, so it is odd to still have the type called AnnDiagram. QDiagram is shorter anyway.

Update user manual to match.

@fryguybob
Copy link
Member Author

(Imported. Original comment by byor...@gmail.com on September 24, 2011, 01:47:36 AM UTC)

Another idea: what if we have the result of running a query be type class-polymorphic over whatever class 'Any' is the initial thing of (in some suitable sense)? That way you don't have to worry about converting your diagrams to whatever particular monoid you want to use, you just query at a particular type and voila.

Monoid itself isn't enough -- that gives us 0 and +, but we also want a distinguished value 1 which is the image of 'Any True'. It doesn't particularly need to have any laws or operations associated with it though. Or perhaps we want semiring -- and can associate some interesting meaning to the * operation on queries? Some sort of alternate diagram composition? Perhaps see Numeric.Rig.Class from the 'algebra' package.

The other upshot of this change is that we can do away with the Q(Ann)Diagram/Diagram split entirely. There would no longer be any benefit to having a version specialized to Any (would there?).

@ghost ghost assigned byorgey Aug 4, 2012
@fryguybob
Copy link
Member Author

(Imported. Original comment by byor...@gmail.com on September 28, 2011, 11:57:56 PM UTC)

Actually, ignore that last idea: one often wants to be able to assign much more initial structure than would be afforded by a semigroup class or something similar. For example, consider having a query that returns the set of names/identifiers of all subdiagrams overlapping at a given point. The part about renaming AnnDiagram still stands, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants