Skip to content

Conversation

@fisx
Copy link
Contributor

@fisx fisx commented Dec 16, 2025

https://wearezeta.atlassian.net/browse/WPB-22451

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@fisx fisx changed the title More schema-profunctor docs [WPB-22451] More schema-profunctor docs Dec 16, 2025
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Dec 16, 2025
-- JSON-encoded value of type @a@ and produces a value of type @b@,
-- while the serialiser portion of @sch@ takes a haskell value of type
-- @a@ and produces a JSON-encoding of something of type @b@.
-- @b@ and produces a JSON-encoding of something of type @a@.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was right before. The "flow" of information is always a -> b, otherwise the profunctor instance wouldn't work.

Comment on lines +216 to +218
-- 'Applicative' interface of 'SchemaP d v w a b'. Example: This is
-- used for writing schemas of objects that draw their field from more
-- than one different schema.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the example is referring to. ObjectSchema is actually used all the time, because it's the argument of object.

-- The idea of using the profunctor structure of 'SchemaP' is taken
-- from the [codec](https://github.com/chpatrick/codec) library.
-- from the [codec](https://github.com/chpatrick/codec)
-- library. (TODO: why are we using this and not codec?)
Copy link
Contributor

@pcapriotti pcapriotti Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think codec supports swagger. There are other libraries that do, but they weren't available when I wrote this. Also now that we have written this library, tailored it to our use case and adapted all our code, what would even be the point of using something else? And why write it here as a TODO instead of just writing a comment or asking me directly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants