const uniqueValues = S.filter((a: Array<unknown>) => a.length === new Set(a).size || "All values must be unique");
const Things = S.Array(S.Literal("foo", "bar", "baz")).pipe(uniqueValues)
const program = Effect.gen(function* () {
console.log(S.decodeSync(Things)("foo,bar") === ["foo", "bar"])
console.log(S.encodeSync(Things)(["foo", "bar"]) === "foo,bar")
S.decodeSync(Things)("foo,foo") // should throw an error
S.encodeSync(Things)(["foo", "foo"]) // this should be a type error
})
const uniqueValues = S.filter((a: Array<unknown>) => a.length === new Set(a).size || "All values must be unique");
const Things = S.Array(S.Literal("foo", "bar", "baz")).pipe(uniqueValues)
const program = Effect.gen(function* () {
console.log(S.decodeSync(Things)("foo,bar") === ["foo", "bar"])
console.log(S.encodeSync(Things)(["foo", "bar"]) === "foo,bar")
S.decodeSync(Things)("foo,foo") // should throw an error
S.encodeSync(Things)(["foo", "foo"]) // this should be a type error
})