diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Util.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Util.hs index 5b39d84a31..e4c86e42d6 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Util.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Util.hs @@ -12,6 +12,7 @@ {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} +{-# LANGUAGE StandaloneKindSignatures #-} {-# LANGUAGE UndecidableInstances #-} -- | Miscellaneous utilities @@ -102,6 +103,7 @@ import Data.Word (Word64) import GHC.Generics (Generic) import GHC.Stack import Ouroboros.Consensus.Util.IOLike +import Ouroboros.Network.Protocol.LocalStateQuery.Codec (Some (..)) import Ouroboros.Network.Util.ShowProxy (ShowProxy (..)) {------------------------------------------------------------------------------- @@ -111,9 +113,6 @@ import Ouroboros.Network.Util.ShowProxy (ShowProxy (..)) class Empty a instance Empty a -data Some (f :: k -> Type) where - Some :: f a -> Some f - -- | Pair of functors instantiated to the /same/ existential data SomePair (f :: k -> Type) (g :: k -> Type) where SomePair :: f a -> g a -> SomePair f g @@ -122,7 +121,8 @@ data SomePair (f :: k -> Type) (g :: k -> Type) where -- -- @SomeSecond f a@ is isomorphic to @Some (f a)@, but is more convenient in -- partial applications. -data SomeSecond (f :: Type -> Type -> Type) a where +type SomeSecond :: (k1 -> k2 -> Type) -> k1 -> Type +data SomeSecond f a where SomeSecond :: !(f a b) -> SomeSecond f a mustBeRight :: Either Void a -> a @@ -368,6 +368,7 @@ allDisjoint = go Set.empty (......:) :: (y -> z) -> (x0 -> x1 -> x2 -> x3 -> x4 -> x5 -> x6 -> y) -> (x0 -> x1 -> x2 -> x3 -> x4 -> x5 -> x6 -> z) (f ......: g) x0 x1 x2 x3 x4 x5 x6 = f (g x0 x1 x2 x3 x4 x5 x6) + {------------------------------------------------------------------------------- Product -------------------------------------------------------------------------------}