8000 Remove `Step` after top level singleton · Issue #113 · silkapp/rest · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove Step after top level singleton #113

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

Open
hesselink opened this issue Mar 12, 2015 · 5 comments
Open

Remove Step after top level singleton #113

hesselink opened this issue Mar 12, 2015 · 5 comments

Comments

@hesselink
Copy link
Member

Right now, the Schema constructor takes a top level construct (Maybe (Cardinality sid mid)), and a Step. However, when the top level thing is Single, it doesn't make sense to have the subsequent Step: nesting listings and getters on top of a singleton getter is weird, and for statics you can get the same effect with actions. The statics also don't work.

Rather than trying to make the statics work, I propose to remove the Step if the top level thing is a Single. This is a breaking change to Schema (which people probably don't use) and singleton. It would also probably be a bit of work in the router and perhaps rest-gen. @bergmark What do you think?

@bergmark
Copy link
Member

I don't really know how Schema "works" so I can't really comment on that but the rationale is good.

From an API perspective:

  • What is the current behavior, will end points silently be ignored?
  • What will the behavior be after this change? Type error?
  • Should we add a smart constructor for singletons?

@hesselink
Copy link
Member Author

What do you mean how it "works"? It defines the schema (think urls) for the resource.

To answer your bullets:

  • Yes. This is very confusing and is how I found this out.
  • Yes. The signature of singleton will change and it will no longer take a list of steps.
  • We have, it's called singleton. :)

@bergmark
Copy link
Member

What I meant was that I didn't see the implications of removing the Step.
But this sounds good to me!

@bergmark
Copy link
Member

Oh and also, i meant having a mkSingleton along with mkResource*, but perhaps that doesn't add much?

@hesselink
Copy link
Member Author

No, I don't think so. We have mkResource* because there's no sensible default for the enter function. Schemas have sensible defaults and you can just fill them in with singleton Bla, so I don't see the reason for adding mkSingleton.

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

No branches or pull requests

2 participants
0