Closed KingoftheHomeless closed 5 years ago
:heart: it, thanks! I'll look into cutting a new release tomorrow.
Are we good to land 1.2? I'll do it today
We're ready.
I'm planning on a Tagged
effect, but it probably belongs in the zoo.
Or hell, Tagged
's honestly already ready. This is its components:
newtype Tagged k e m a where
Tagged :: forall k e m a. e m a -> Tagged k e m a
tag :: forall k e r a
. Member (Tagged k e) r
=> Sem (e ': r) a
-> Sem r a
untag :: forall k e r a
. Sem (Tagged k e ': r) a
-> Sem (e ': r) a
retag :: forall k1 k2 e r a
. Member (Tagged k2 e) r
=> Sem (Tagged k1 e ': r) a
-> Sem r a
Do you think it should be part of polysemy
?
Example of use:
taggedLocal :: forall k i r a
. Member (Tagged k (Reader i)) r
=> (i -> i)
-> Sem r a
-> Sem r a
taggedLocal f m =
tag @k @(Reader i) $ local @i f (raise m)
Should have said that to start with.
Well, in any case, my opinion is that it both can and should wait.
Ahh, sorry! I'm happy to push out a 1.2.1.0 sooner than later if we want to get this in.
The thorny thing about Tagged
is the question if we should create predefined tagged-
variants (like taggedLocal
) for everything. That's a hairy enough question for me not to put it in right now.
This can be merged once we decide to release polysemy v1.2