-
Notifications
You must be signed in to change notification settings - Fork 12
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
Weaken constraint from Monoid to Semigroup #26
base: master
Are you sure you want to change the base?
Conversation
Can we switch back to Travis or GitHub Actions? We don't use GitLab for this project. |
Why is this change needed? Why do we need enummaps? |
I don't have the permissions to setup Github actions (or Gitlab CI for that matter). I can add a travis config. |
I think it's enabled by default unless explicitly disabled. If you use Travis please use haskell-ci to generate a config. I'm fine either of GitHub Actions or Travis. |
This breaks a bunch of stuff: * startUpdateNetwork and startUpdateNetworkWithValue now return 'Maybe a' instead of 'a' if no change has happened since the last sample. * 'Update' no longer has an Applicative instance. An Applicative instance isn't possible (nicely) with only a Semigroup constraint. I've also removed IOMonoid since, as of base 4.9.0.0, IO has an identical Monoid instance.
d6f7001
to
59ca757
Compare
I've added an actions workflow. You can see a run here: https://github.com/leifmetcalf/euphoria/actions/runs/144463831 |
df3da17
to
3d67396
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'm still not sure why the Semigroup constraint is better. Could you elaborate a bit?
b06b1b5
to
e8f99a8
Compare
You cannot implement g :: Maybe Text -> IO ()
g Nothing = pure ()
g (Just s) = putStrLn s We can avoid this by changing the constraint in Update from Monoid to Semigroup. Instead of handling the no-event case in the FRP code, we handle it in the sampling code: startUpdateNetwork :: Update a -> IO (IO (Maybe a) {- sample -}, IO () {- step -}) |
@maoe Why would we want an Applicative instance for update? |
This breaks a bunch of stuff:
startUpdateNetwork and startUpdateNetworkWithValue now return
'Maybe a' instead of 'a' if no change has happened since the last
sample.
'Update' no longer has an Applicative instance. An Applicative
instance isn't possible (nicely) with only a Semigroup constraint.
I've also removed IOMonoid since, as of base 4.9.0.0, IO has an
identical Monoid instance.