Handling Schema Decoding Failures with Fallback to Undefined
this feels like a dumb question, but how would you write a schema such that if part of decoding fails, it falls back to
I know that I can use
So that I could call
https://effect.website/play/#afaabcd87587
null? For example:I know that I can use
Schema.transform to catch a failure manually, but is there a way to make this pattern more generic where it can attempt any transform and catch it if it fails:So that I could call
MakeSafe(MySchema) and it would make the whole value nullable when a transformation fails? I specifically do not want to do this at the Schema.decode call site or level because this struct is actually deeply nested inside another one, and I only want the one value to fail with null if it doesn't transform successfully.https://effect.website/play/#afaabcd87587
