Effect CommunityEC
Effect Community15mo ago
7 replies
BlueBeka

Make Compatible Brands in 3rd party library

I'm trying to make the brands in library (umo-types) compatible with effect's Brand type, without requiring effect as a peer dependency. Is this possible?

Essentially, I can branding things like this in my library:
import type { Brand } from "effect/Brand";
export type Unit<A, B> = number & Brand<"uom"> & { __a: A; __b: B; };

But this requires effect to be a peer dependency.
Is there anyway I make the type compatible by either not directly using effect or by somehow using {} instead of Brand<"uom"> if effect isn't present?

Any ideas?
Was this page helpful?