const fetchPage = (name: string, params: QueryParams) =>
pipe(
Effect.try(() => makeUrl(name, params)),
Effect.flatMap(zytePageFetcher.getPage),
Effect.flatMap(Schema.decode(Schema.parseJson(RawRedditListing))),
Effect.catchAll((e) => Effect.fail(new SpecialError(`Failed to get listing: ${e}`))),
);
const fetchPage = (name: string, params: QueryParams) =>
pipe(
Effect.try(() => makeUrl(name, params)),
Effect.flatMap(zytePageFetcher.getPage),
Effect.flatMap(Schema.decode(Schema.parseJson(RawRedditListing))),
Effect.catchAll((e) => Effect.fail(new SpecialError(`Failed to get listing: ${e}`))),
);