-
Notifications
You must be signed in to change notification settings - Fork 149
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
runHost function #305
runHost function #305
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but I'd like to review it in the context of a paired commit that uses this in reflex-dom.
src/Reflex/Main.hs
Outdated
|
||
type EventChannel t = Chan [DSum (EventTriggerRef t) TriggerInvocation] | ||
|
||
runHost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's give this a slightly longer name, like runHostWithIO
, to indicate that it grants access to IO. I don't want people to get the impression that all hosts can/should support IO.
If you wanted to take anything from https://github.com/qfpl/reflex-basic-host/blob/master/src/Reflex/Host/Basic.hs for this, feel free. It started life as almost exactly what you have here, then I needed the ability to sometimes use an Event to shutdown the host, which is where it started to diverge, and then I needed a newtype and the various instances to use this in a context where the pile-o'-constraints approach was giving me grief. |
Having an event to shut down reflex-dom apps would be great :)
…On Thu, May 2, 2019, 16:17 Dave Laing ***@***.***> wrote:
If you wanted to take anything from
https://github.com/qfpl/reflex-basic-host/blob/master/src/Reflex/Host/Basic.hs
for this, feel free.
It started life as almost exactly what you have here, then I needed the
ability to sometimes use an Event to shutdown the host, which is where it
started to diverge, and then I needed a newtype and the various instances
to use this in a context where the pile-o'-constraints approach was giving
me grief.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#305 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAI2KYCSMRTU74IH4S4DDM3PTND33ANCNFSM4HJ6RXSQ>
.
|
I've been looking at adding that kind of event to as many of the reflex-dom backends as I can, for use with criterion and QuickCheck/Hedgehog... |
@dalaing It sounds like it would be great to base reflex-dom on that! |
It would be nice if something like this also worked with reflex-vty. |
OK Good CI works. Next steps are:
|
Is this still relevant given that |
I think the point of this was to provide something to make it easier to implement headless, vty, or other hosts. |
Adding a function for creating new hosts with PerformEvent and PostBuild easily. Currently having some trouble getting it to work in the context we need, and haven't documented it yet, so WIP