Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hoistDeclare #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add hoistDeclare #22

wants to merge 3 commits into from

Conversation

masaeedu
Copy link

As an example, this lets us lift:

declareSchema :: ToSchema a => Proxy a -> Declare (Definitions Schema) Schema 

into:

declareSchema' :: ToSchema a => Proxy a -> Declare Components Schema 
declareSchema' = hoistDeclareT schemas . declareSchema

@dylex
Copy link

dylex commented Apr 30, 2022

I also found this useful. To be consistent with Lens, this should maybe be called zoomDeclare.

(To be honest, at the end of the day I ended up just switching to MonadState since it's more flexible and efficient, and has a bunch more functionality available.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants