import * as Context from "effect/Context"; export const GenericService = < Fn extends (T: { Type: string }) => Context.Service = ( ...args: any[] ) => Context.Service, >() => (Kind: string): ReturnType & Fn => { const service = Context.Service(Kind); const make = (Type: string) => Context.Service(`${Kind}<${Type}>`); return Object.assign( Object.setPrototypeOf(make, service), service, ) as ReturnType & Fn; };