-
Notifications
You must be signed in to change notification settings - Fork 21
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
rhine-terminal backend with haskell-terminal library and Repl like example #165
Conversation
I'll have a look :) no idea how I reproduce on |
https://github.com/turion/rhine/runs/6568785125?check_suite_focus=true fails with |
Merge #164 first. |
I've given this a spin. No idea what it's supposed to do exactly.
|
The issue you had was that your |
Ironically, this is exactly the kind of bug |
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.
Alright, so this seems in good shape for me to go forward! It seems terminal
can be used as a rhine backend. Some todos to proceed:
- Add
rhine-terminal
tocabal.project
andstack.yaml
. - Factor out the terminal clock to a library.
- Keep the executable as an example application.
- If you're motivated add an integration test that produces some characters on stdout.
Ha ha ha, well I suspected the bug was in my mis-use of rhine :) Looking forward to dig into this. Super grateful for being unblocked 🙏 |
Hi @turion , So I got started on the todo list:
I've added
I've made good progress I think and followed the
Happy to try when the example works! Some questions about ways to compose rhines and signal networksWith regards to your fix and my misunderstanding, I see that you refactored the Rhines such that they are composed with "Time-parallel signal composition", using However this leaves me wondering whether it's possible to fix the problem while keeping the original intent composing sensors and actuators like so: Should there be a way to compose Rhines : compRhines :: Rhine m cl a b -> Rhine m cl b c -> Rhine m cl a c I understand from the paper that Rhines and Signal Networks don't form categories in general, but it seems that when clocks have the same values (or maybe the same tree structure?) it should be possible to compose Rhine end to end like that? Another way to ask the same question I suppose is: is there currently a way to consume a I've committed the application code with the refactor and added the |
👍
No, the fewer places where we need to list things, the better.
Yes, but that's not blocking.
I believe it's your
👍
Awesome graphics :) yes, this is also how I'd look at them I think.
No, this doesn't work, for two reasons.
If we make both assumptions, we can write something like your
Huh, it seems you've hit a bullseye. It should morally be possible to precompose it with a You can definitely postcompose with a pure function: https://hackage.haskell.org/package/rhine-0.7.1/docs/src/FRP.Rhine.SN.Combinators.html#%3E%3E%3E%5E It should be easy to generalise this to a Kleisli arrow
Not in general I believe. |
We cannot do MonadIO here. UnliftIO works in principle, but I don't think it's worth the dependency. I'm working on another solution to concurrency currently which removes the need for schedules, so we shouldn't put too much effort in that direction.
--
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
|
570615f
to
d3be9ff
Compare
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.
I hope you'll bear with my meticulous review style 😅 I can find a lot of small details if I go looking.
rhine-terminal/TerminalSimple.hs
Outdated
{-# LANGUAGE MultiParamTypeClasses #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE TypeFamilies #-} | ||
{-# LANGUAGE UndecidableInstances #-} |
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.
Remove if possible.
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.
Since I use Text
OverloadedString is nice. The rest is not used indeed,
rhine-terminal/TerminalSimple.hs
Outdated
, select } | ||
where | ||
select :: Tag TerminalEventClock -> Maybe Input | ||
select = \case |
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.
In fact if you use \case
, you can define it directly without a where
clause! I like that a lot. I'll use \case
more in my own code I think.
Not at all! Thanks for your patience, I didn't have tons of time in the past couple of weeks :) I think I've addressed all your comments. Feel free to request more changes if you catch anything 👍 |
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.
Fantastic! Thanks a lot for contributing!
As per #161 this is my attempt at using the
haskell-terminal
library withrhine
and succeeding very moderately, as this works dreadfully slowly.I've stacked the PR on top of my
flake
branch so it's easy to build and run this way:Running this should show a prompt, with a blinking
.
before a>
and a terminal cursor after it. When pressing keys, they appear but after a long delay. This slow behavior exists both onaarch64
andx86
. Let me know if you can reproduce :)I haven't yet split out the Terminal related functionality into a module like
FRP.Rhine.Gloss
yet as we work through the performance problems!