effect icon indicating copy to clipboard operation
effect copied to clipboard

Typos and remarks regarding the docs

Open parischap opened this issue 2 years ago • 0 comments

What is the type of issue?

Documentation is incorrect

What is the issue?

I just went through the whole documentation again as I discovered many changes since the last time I looked. It's all very impressive.

Just a few remarks though:

  1. In "Optional fields as Options" (https://github.com/Effect-TS/schema#optional-fields-as-options), I think: const schema = S.struct({ a. S.optional(S.number).toOption() });

should read:

const schema = S.struct({ a: S.optional(S.number).toOption() });

  1. I see there is an S.InstanceOf operator for classes. Maybe, there could be on for structs?

  2. I have always been puzzled by the Transform combinator. More so now that we have the Compose combinator. Instead of the Transform combinator which implies two schemas and potentially 4 types of which 2 are not used, why not have a Make constructor like so make: <A, B,>(decode: (a: A) => B, encode: (b: B) => A) => Schema<A, B>?

  3. Maybe something should be said about S.NumberToString (starting with an uppercase N) which is a transformation and S.numberToString (starting with a lowercase n) which is a schema

Where did you find it?

No response

parischap avatar Oct 05 '23 19:10 parischap