Skip to content
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

Implement Semigroup-Monoid-Proposal (needed for GHC 8.4.1) #32

Closed
ggreif opened this issue Apr 25, 2018 · 2 comments
Closed

Implement Semigroup-Monoid-Proposal (needed for GHC 8.4.1) #32

ggreif opened this issue Apr 25, 2018 · 2 comments

Comments

@ggreif
Copy link
Contributor

ggreif commented Apr 25, 2018

    [24 of 29] Compiling FRP.Rhine.Clock.Realtime.Stdin ( src/FRP/Rhine/Clock/Realtime/Stdin.hs, .stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/FRP/Rhine/Clock/Realtime/Stdin.o )
    
    /home/ggreif/stack16020/rhine-0.4.0.0/src/FRP/Rhine/Clock/Realtime/Stdin.hs:33:10: error:
        ? No instance for (Semigroup StdinClock)
            arising from the superclasses of an instance declaration
        ? In the instance declaration for ?Monoid StdinClock?
       |
    33 | instance Monoid StdinClock where
       |          ^^^^^^^^^^^^^^^^^
@ggreif
Copy link
Contributor Author

ggreif commented Apr 25, 2018

I have locally now:

diff --git a/rhine/src/FRP/Rhine/Clock/Realtime/Stdin.hs b/rhine/src/FRP/Rhine/Clock/Realtime/Stdin.hs
index a3c06bd..913e516 100644
--- a/rhine/src/FRP/Rhine/Clock/Realtime/Stdin.hs
+++ b/rhine/src/FRP/Rhine/Clock/Realtime/Stdin.hs
@@ -30,6 +30,9 @@ instance MonadIO m => Clock m StdinClock where
       , initialTime
       )
 
+instance Semigroup StdinClock where
+  (<>) = mappend
+
 instance Monoid StdinClock where
   mempty      = StdinClock
   mappend _ _ = StdinClock

It should probably use CPP conditionals to activate only with new base.

@turion
Copy link
Owner

turion commented May 9, 2018

StdinClock and all other singleton clocks should only be a Semigroup, since this is all that is ever used (currently).

@turion turion closed this as completed Jun 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants