sam-goodwin / punchcard

Type-safe AWS infrastructure.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

generalize enumerables and event sources

sam-goodwin opened this issue · comments

commented

There's a lot of redundancy in the enumerable implementations: https://github.com/sam-goodwin/punchcard/tree/master/packages/punchcard/lib/enumerable

Can we extract out the common bits into something like a Functor?

Also, the run method is statically mapped to the event type, e.g. SQSEvent, maybe we can model event sources generically, e.g. Queue implements Source<SQSEvent> which exposes subscribe(sink: Sink<SQSEvent>)?

commented

Modeled a nice Functor-like thing-o in this commit: a656da4

Feels right.

commented

Another pass: 1f39fe9

I wonder how difficult it would be to integrate with these guy's Functor: https://github.com/gcanti/fp-ts