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

Attach notification type to db in notify-listen-beam #187

Open
madeline-os opened this issue Feb 17, 2022 · 2 comments
Open

Attach notification type to db in notify-listen-beam #187

madeline-os opened this issue Feb 17, 2022 · 2 comments

Comments

@madeline-os
Copy link
Collaborator

Consider

class HasChangeNotification n a | a -> n where
  changeNotification :: DatabaseEntity be db (TableEntity a) -> n (Change a)

It is difficult to imagine a scenario where one would want to use a different notification type (n above) for two different tables (a above). What is far more likely is that there is one notification type for the entire database db. This would reduce the tedium and increase the clarity of instance declarations for this class.

@danbornside
Copy link
Contributor

proposed new class head:

class HasChangeNotification be n db | db be -> n where
    changeNotification :: DatabaseEntity be db (TableEntity a) -> n (Change a)

@cgibbard
Copy link
Collaborator

@danbornside's version seems fair to me.

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

No branches or pull requests

3 participants