-
Notifications
You must be signed in to change notification settings - Fork 148
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
Fanning sums #316
Comments
Have you looked at the `fan` primitive? I think that may do what
you're looking for.
…On Tue, Jun 25, 2019, 15:28 David Feuer ***@***.***> wrote:
I may not understand this properly, but at first glance it seems that
fanEither should generalize to something like
fanSum :: (GCompare tag, GEnum tag) => Event t (DSum tag f) -> DMap tag (Compose (Event t) f)
where GEnum offers a way to enumerate all the tags. (Possible methods: enumTags
:: [DSum tag Proxy], enumTagsMap :: DMap tag Proxy).
Simplifying to Identity, that's
fanSumId :: (GCompare tag, GEnum tag) => Event t (DSum tag Identity) -> DMap tag (Event t)
The idea is that if we have a stream of messages of various types, we
should be able to separate it into multiple streams, each of which contains
messages of only one type. The big question is whether there's a way to
implement this efficiently. I don't have a clue myself.
Note: I've opened an issue
<obsidiansystems/dependent-sum#29> for dependent-sum
suggesting such a class.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#316?email_source=notifications&email_token=AAI2KYAFSWMMRDM5UDLDJHDP4JWUXA5CNFSM4H3LQB7KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3UGGZA>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAI2KYABJRS735ZQCL2B5MDP4JWUXANCNFSM4H3LQB7A>
.
|
Have you looked at |
@ryantrinkle Ah, I think I see what you mean. Yes, that's probably sufficient, but it seems like overkill. I can turn each |
@3noch |
Possibly, but the hard work is mostly on the subscriber management side,
and it wouldn't be reduced by inputting DSums rather than DMaps. That being
said, this all sounds like interesting stuff and I look forward to seeing
how it goes!
…On Tue, Jun 25, 2019, 15:41 David Feuer ***@***.***> wrote:
@ryantrinkle <https://github.com/ryantrinkle> Ah, I think I see what you
mean. Yes, that's probably sufficient, but it seems like overkill. I can
turn each DSum into a singleton DMap and use fan with that, but it seems
clearer (and at least a bit more efficient) to avoid that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#316?email_source=notifications&email_token=AAI2KYD37VMKQUGR5WL6633P4JYF7A5CNFSM4H3LQB7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYRL2XI#issuecomment-505593181>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAI2KYHYOX7DOKBVDD2GKITP4JYF7ANCNFSM4H3LQB7A>
.
|
If you don't think it matters, then that's fine. It would at least be nice to offer it as a function if not a method, since it takes a bit of mental gymnastics to see that |
Oh, but there is still the matter of type .... Why is |
Oh, that could probably be changed. I think it's just a holdover from when
DMap was one-argument
…On Tue, Jun 25, 2019, 15:52 David Feuer ***@***.***> wrote:
Oh, but there is still the matter of type .... Why is fan only for
Identity?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#316?email_source=notifications&email_token=AAI2KYGSZ6PCX3LCPUJPDNDP4JZQXA5CNFSM4H3LQB7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYRM25A#issuecomment-505597300>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAI2KYEWEE67CMOY3UETWZDP4JZQXANCNFSM4H3LQB7A>
.
|
Implemented as PR #318 |
I may not understand this properly, but at first glance it seems that
fanEither
should generalize to something likewhere
GEnum
offers a way to enumerate all the tags. (Possible methods:enumTags :: [DSum tag Proxy]
,enumTagsMap :: DMap tag Proxy
).Simplifying to
Identity
, that'sThe idea is that if we have a stream of messages of various types, we should be able to separate it into multiple streams, each of which contains messages of only one type. The big question is whether there's a way to implement this efficiently. I don't have a clue myself.
Note: I've opened an issue for
dependent-sum
suggesting such a class.The text was updated successfully, but these errors were encountered: