obsidiansystems / rhyolite

BSD 3-Clause "New" or "Revised" License
26 stars 17 forks source link

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

Open madeline-os opened 2 years ago

madeline-os commented 2 years ago

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 commented 2 years ago

proposed new class head:

class HasChangeNotification be n db | db be -> n where
    changeNotification :: DatabaseEntity be db (TableEntity a) -> n (Change a)
cgibbard commented 2 years ago

@danbornside's version seems fair to me.