Skip to content

[RFC] Research ways to support tagged effectsΒ #16

@chshersh

Description

@chshersh

Sometimes we want to reuse the same effect implementation but for different environment settings. Examples:

  1. Different JWT tokens for different applications.
  2. Different DB settings for different databases.
  3. Support measuring with either EKG or Prometheus.

So it looks like some effects should be tagged (it's not tagless final anymore).

Initial idea: instead of

class MonadJwt m where

have

class MonadJwt (tag :: k) m where

So in constraints this will look like this:

foo :: (MonadJwt "app1" m, MonadJwt "app2" m) => ...

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions