effect icon indicating copy to clipboard operation
effect copied to clipboard

`Types/MergeRight` and `Types/MergeLeft` lose optionality

Open nspaeth opened this issue 1 year ago • 0 comments

What version of Effect is running?

3.10.1

What steps can reproduce the bug?

import { MergeRight, MergeLeft } from "effect/Types"

type A = { a?: number }
type B = { b: string }
type mr = MergeRight<A, B>
type ml = MergeLeft<A,B>

Playground

What is the expected behavior?


type mr = {
    a?: number;
    b: string;
}
type ml = {
    a?: number;
    b: string;
}

What do you see instead?


type mr = {
    a: number | undefined;
    b: string;
}
type ml = {
    a: number | undefined;
    b: string;
}

Additional information

import { Merge } from 'type-fest' does preserve optionality.

nspaeth avatar Oct 23 '24 07:10 nspaeth