Skip to content

Commit

Permalink
Merge #2875
Browse files Browse the repository at this point in the history
2875: Allow to acquire tip by LocalStateQuery protocol client. r=coot a=coot

* Change mini-protocol description
* Redefine codec, add a test which ensures that the new version of the codec is compatible with the previous one.
* Updated consensus, including the server.
* Added new supported version in `ouroboros-consensus-cardano`
As a bonus:
* `instance Monoid a => Monoid (IOSim s a)`

Co-authored-by: Marcin Szamotulski <profunctor@pm.me>
  • Loading branch information
iohk-bors[bot] and coot authored Jan 18, 2021
2 parents 9d7fd71 + 3d52c73 commit 24eccd3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions io-sim/src/Control/Monad/IOSim/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import Data.Typeable (Typeable)
import Quiet (Quiet (..))
import GHC.Generics (Generic)

import Control.Applicative (Alternative (..))
import Control.Applicative (Alternative (..), liftA2)
import Control.Exception (ErrorCall (..), assert,
asyncExceptionFromException, asyncExceptionToException)
import Control.Monad (MonadPlus, join)
Expand Down Expand Up @@ -195,6 +195,16 @@ instance Monad (IOSim s) where
fail = Fail.fail
#endif

instance Semigroup a => Semigroup (IOSim s a) where
(<>) = liftA2 (<>)

instance Monoid a => Monoid (IOSim s a) where
mempty = pure mempty

#if !(MIN_VERSION_base(4,11,0))
mappend = liftA2 mappend
#endif

instance Fail.MonadFail (IOSim s) where
fail msg = IOSim $ \_ -> Throw (toException (IO.Error.userError msg))

Expand Down Expand Up @@ -236,7 +246,6 @@ instance Alternative (STM s) where

instance MonadPlus (STM s) where


instance MonadSay (IOSim s) where
say msg = IOSim $ \k -> Say msg (k ())

Expand Down

0 comments on commit 24eccd3

Please sign in to comment.