Open hesselink opened 9 years ago
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 do you mean how it "works"? It defines the schema (think urls) for the resource.
To answer your bullets:
singleton
will change and it will no longer take a list of steps.singleton
. :)What I meant was that I didn't see the implications of removing the Step. But this sounds good to me!
Oh and also, i meant having a mkSingleton
along with mkResource*
, but perhaps that doesn't add much?
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
.
Right now, the
Schema
constructor takes a top level construct (Maybe (Cardinality sid mid)
), and aStep
. However, when the top level thing isSingle
, it doesn't make sense to have the subsequentStep
: 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 aSingle
. This is a breaking change toSchema
(which people probably don't use) andsingleton
. It would also probably be a bit of work in the router and perhaps rest-gen. @bergmark What do you think?