( self: ReadonlyRecord<K, Result<A, E>> )
| 897 | * |
| 898 | * **Example** (Partitioning with Result) |
| 899 | * |
| 900 | * ```ts import.meta.vitest |
| 901 | * import { Record, Result } from "effect" |
| 902 | * |
| 903 | * const x = { a: 1, b: 2, c: 3 } |
| 904 | * const f = (n: number) => (n % 2 === 0 ? Result.succeed(n) : Result.fail(n)) |
| 905 | * Record.partition(x, f) // => [{ a: 1, c: 3 }, { b: 2 }] |
| 906 | * ``` |
| 907 | * |
| 908 | * @category filtering |
| 909 | * @since 2.0.0 |
| 910 | */ |
| 911 | export const partition: { |
| 912 | <K extends string, A, B, C>( |
| 913 | f: (input: A, key: K) => Result<C, B> |
| 914 | ): ( |