Simpler effect representations creation
currently, effect representations are created like following:
interface IO extends Spec<'IO'> {
read(): string
write(text: string): void
}
const IO = createEffect<IO>('IO')
Here, name of effect is repeated 5 times. this makes look of API verbose and makes users be tired of writing name of effects. Using interface, adding discrimination tag to spec type, having effect representation in variable, mentioning name of spec when creating effect representation seems to be inevitable. But giving name of effect we want to create as string literal seems to be avoidable and I really hope so. let's find a way.
Here, I share my failed try. I tried to use symbols to dynamically -- and the way user don't notice -- generate identifier of effect representation but found this kind of work would make handler API verbose.
Update: now we define effects like blow
type IO = Effect<'IO', {
read(): string
write(text: string): void
}>
const IO = createPrimitives<IO>('IO')
It's better but still have annoying repeat of effect name