Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upPartial query evaluation #576
Conversation
garyb
added some commits
Sep 8, 2018
garyb
requested a review
from
natefaubion
Sep 23, 2018
garyb
reviewed
Sep 23, 2018
| , handleQuery :: forall a. f a -> HalogenM s act ps o m (Maybe a) | ||
| , receive :: i -> Maybe act | ||
| , initialize :: Maybe act | ||
| , finalize :: Maybe act |
This comment has been minimized.
This comment has been minimized.
garyb
Sep 23, 2018
Member
I guess these could be Maybe (HalogenM s act ps o m Unit) rather than going via action handling, but I kinda like handling these in one place (which is already true if HalogenQ is handled rather than going the mkEval route).
This comment has been minimized.
This comment has been minimized.
natefaubion
Sep 23, 2018
Collaborator
I don't think they would need to be Maybe, since they can just be pure unit.
This comment has been minimized.
This comment has been minimized.
garyb
Sep 23, 2018
Member
That's true - it was more a comment on them mapping to act rather than operating directly in HalogenM.
natefaubion
approved these changes
Sep 23, 2018
|
I think this looks good. Since we have |
safareli
reviewed
Sep 25, 2018
src/Halogen/Aff/Driver/Eval.purs Outdated
safareli
reviewed
Sep 25, 2018
| , finalize :: Maybe act | ||
| } | ||
|
|
||
| mkEval |
This comment has been minimized.
This comment has been minimized.
safareli
Sep 25, 2018
Contributor
What you think about calling mkEval from mkComponent (i.e. ComponentSpec taking EvalSpec ?
This comment has been minimized.
This comment has been minimized.
garyb
Sep 25, 2018
Member
We can't do that without exposing another different version of mkComponent, since Halogen uses it internally. Plus I wanted to provide the choice of writing an eval in terms of HalogenQ directly.
Having mkEval in there seemed better given both of those considerations, as it should avoid some confusion about things like when we had 4 different component constructors before - they were all the same aside from some synonyms and field-defaulting, but that wasn't obvious to the casual user. Since the same actual component constructor is used here, and we just use another function to build up part of its internals, it shows that there's nothing special going on, no matter how the component is constructed.
This comment has been minimized.
This comment has been minimized.
|
more I like mkEval
:: forall s f act ps i o m
. (EvalSpec s f act ps i o m -> EvalSpec s f act ps i o m)
-> HalogenQ f act i ~> HalogenM s act ps o mdoes no longer require expose |
This comment has been minimized.
This comment has been minimized.
|
I did consider that too, or exporting a function that does that as well as having a |
garyb commentedSep 23, 2018
Check it out @natefaubion!
Two-fold rationale:
Nothingthat leaves us free to have the query type polymorphic until a real eval is provided for it.I've only updated two of the examples, for proof that it's usable, as I wanted to see if we can think of reasons why we shouldn't do this.