Function Schemable #228
Closed
jacob-alford
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
My concern with a function Schemable is that it might make it seem that it's possible to guard for/decode an unknown to a function of known shape. Consider the following: const f: (a: string, b: string) => string = (a, b) => `${a}${b}`
const Fn = S.Function([S.Number, S.Number], S.Number)
const guard = getGuard(Fn)
guard.is(f) // true I'm not sure if it's possible to guard/decode that |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
WithFunction will be a schemable mostly useful for deriving TypeScriptNodes. I don't think it can have much use outside of that, for example Decoder can detect the number of parameters, but not the types of those parameters.
Beta Was this translation helpful? Give feedback.
All reactions