Replies: 3 comments 16 replies
-
When I've been referring to the I also recently referred to (in the above framework) the implementation of a Schemable for a Typeclass (I'll just call them Schemable Typeclasses) as Interpreters. I think this is wrong, an interpreter is just a function: So to recap:
On point three* On this topic, I also want to discuss not adopting the new schema system of If we decide not to adopt the unsafe Provider schema system of fp-ts/schema, we can still port io-ts's implementations and adjust the definitions for Decoder / etc to be in line with fp-ts/schema so the generated typeclasses are compatible between the two libraries. This would make |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
What about renaming Schemable Typeclasses (decoder, encoder, etc) to "Derivations?" This will make it easier to distinguish between schemable extensions, which we can just call schemables. |
Beta Was this translation helpful? Give feedback.
-
I feel like we need to discuss the terminology used.
My understanding is:
Eq
is "a schemable". Equivalently,Eq
implementsSchemable
or, most verbosely,Eq
permits aSchemable
instance.T
(plural schemata) is a thing that can beinterpret
ed with a schemable to produce a value of the schemable for typeT
. For example, interpreting aSchema
forFoo
withEq
yields aEq<Foo>
I think those two are pretty clear and I think we've all been using the same terminology for them.
Where I'm unsure are:
WithX
things. What are they? They aren't Schemables. I've been thinking of them as "schemable extensions" but if we eventually move to a more dynamic model where what a Schema needs depends on what is inside of it, then it's not necessarily an extension anymore. E.g. if we have a Schema that only depends onpattern
then it only needs to be interpreted with aWithPattern
instance.They are typeclasses, yes, but I think we need something a bit more specific since we can't create a schema based on (say) a
Witherable
Schemable
or theWithX
things? e.g. lowercaseint
. I guess, sinceSchemable
andWithX
things are both typeclasses, these would be methods?Since the unifying characteristic of all these things is that they can be used to
interpret
aSchema
, I am tempted to propose "interpretable" but to me that sounds more like a synonym for aSchema
. Instead of being able to be interpreted, it is the means by which it is interpreted. By analogy to spoken language interpreters:Schema
interpret
Schemable
/WithX
Beta Was this translation helpful? Give feedback.
All reactions