app: better session id handling

This commit is contained in:
Brendan Allan
2026-03-21 21:49:01 +08:00
parent fb6bf0b35e
commit cf3df010ce
17 changed files with 396 additions and 305 deletions
+11
View File
@@ -0,0 +1,11 @@
import { dual } from "effect/Function"
export namespace Optional {
export const map = dual<
<I, O>(f: (value: I) => O) => (opt: I | undefined) => O | undefined,
<I, O>(opt: I | undefined, f: (value: I) => O) => O | undefined
>(2, (opt, f) => {
if (opt === undefined) return undefined
return f(opt)
})
}