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

Exposed simple cookie functions via Main interface. #395

Merged
merged 3 commits into from
Apr 20, 2024

Conversation

tusharad
Copy link
Contributor

As mentioned in #350 issue. I have exposed the cookie module from Web.Scotty & Web.Scotty.Trans. Though I only exported simple functions of the cookie module which are:

  1. setSimpleCookie
  2. getCookie
  3. getCookies
  4. deleteCookie
  5. makeSimpleCookie

If the user wants to use SetCookie functions then the user should import Web.Scotty.Cookie.
Let me know if I should expose all the functions or not.
Thanks.

@ocramz

Web/Scotty.hs Outdated
@@ -52,6 +52,7 @@ module Web.Scotty
-- * Types
, ScottyM, ActionM, RoutePattern, File, Content(..), Kilobytes, ErrorHandler, Handler(..)
, ScottyState, defaultScottyState
, module Web.Scotty.Cookie
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think explicit export list is more preferable because the type signatures show up in the Haddock.

@tusharad
Copy link
Contributor Author

Thanks for the suggestion @fumieval! Added explicit function list.

@ocramz
Copy link
Collaborator

ocramz commented Apr 18, 2024

Thank you @tusharad , great!

Could you please also update the example program in examples/, so that it uses the new API?

@tusharad
Copy link
Contributor Author

Hi @ocramz , I changed the examples/cookies.hs example. Let me know if you want anything else.

@ocramz ocramz merged commit 85ed0b2 into scotty-web:master Apr 20, 2024
6 checks passed
@ocramz
Copy link
Collaborator

ocramz commented Apr 20, 2024

Thank you @tusharad !

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.

3 participants