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

Replace Aggregator module with contents of AggregatorSuper? #79

Open
tomjaguarpaw opened this issue Sep 5, 2014 · 1 comment
Open
Labels

Comments

@tomjaguarpaw
Copy link
Collaborator

I've come up with a concept of "super" aggregator which is the same as our current Aggregator but with slightly nicer structure. In particular it allows us to write countAll :: Aggregator () (Wire Int64) which was impossible with the old approach (see #76).

(Example usage of the super aggregator)

Once I've implemented everything, it should be API compatible with the old Aggregator module with one exception. The type off aggregate has changed from

aggregate :: Aggregator a b -> Query a -> Query b

to

aggregate :: (D.Default (PP.PPOfContravariant U.Unpackspec) a a,
          D.Default (PP.PPOfContravariant U.Unpackspec) b b)
          => Aggregator a b -> Query a -> Query b

The new version is a bit more messy, but we're used to this sort of use of the Default typeclass by now. In pretty much all uses the new version will still work because we will have suitable instances for our a and b.

Should I just go ahead and replace the old module with the new one?

@bergmark
Copy link

bergmark commented Sep 7, 2014

Sure!

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

No branches or pull requests

2 participants