on master help sign in
Better GADT signatures
96b2bb3Andrzej Rybczak
effectful-core/src/Effectful/Internal/Effect.hs+1−1
@@ -18,7 +18,7 @@ import GHC.TypeLits
18type Effect = (Type -> Type) -> Type -> Type
18type Effect = (Type -> Type) -> Type -> Type
19
19
20-- | Adapter for statically dispatched effects.
20-- | Adapter for statically dispatched effects.
21−newtype IdE (e :: Effect) where
21+newtype IdE :: Effect -> Type where
22 IdE :: (forall m r. e m r) -> IdE e
22 IdE :: (forall m r. e m r) -> IdE e
23
23
24-- | A constraint that requires that a particular effect, @e@, is a member of
24-- | A constraint that requires that a particular effect, @e@, is a member of
effectful-core/src/Effectful/Internal/Env.hs+2−1
@@ -30,6 +30,7 @@ module Effectful.Internal.Env
30import Control.Monad
30import Control.Monad
31import Control.Monad.Primitive
31import Control.Monad.Primitive
32import Data.IORef
32import Data.IORef
33+import Data.Kind
33import Data.Primitive.SmallArray
34import Data.Primitive.SmallArray
34import GHC.Exts (Any)
35import GHC.Exts (Any)
35import GHC.Stack (HasCallStack)
36import GHC.Stack (HasCallStack)
@@ -149,7 +150,7 @@ newForkId (ForkIdGen ref) = do
149----------------------------------------
150----------------------------------------
150-- Relinker
151-- Relinker
151
152
152−newtype Relinker i (e :: Effect) where
153+newtype Relinker :: (Effect -> Type) -> Effect -> Type where
153 Relinker
154 Relinker
154 :: ((forall es. Env es -> IO (Env es)) -> handler e -> IO (handler e))
155 :: ((forall es. Env es -> IO (Env es)) -> handler e -> IO (handler e))
155 -> Relinker handler e
156 -> Relinker handler e
effectful/src/Effectful/Async.hs+2−1
@@ -76,6 +76,7 @@ import Control.Concurrent (threadDelay)
76import Control.Concurrent.Async (Async)
76import Control.Concurrent.Async (Async)
77import Control.Exception (Exception, SomeException)
77import Control.Exception (Exception, SomeException)
78import Control.Monad (forever)
78import Control.Monad (forever)
79+import Data.Kind
79import qualified Control.Concurrent.Async as A
80import qualified Control.Concurrent.Async as A
80import qualified UnliftIO.Async as U
81import qualified UnliftIO.Async as U
81import qualified UnliftIO.Internals.Async as I
82import qualified UnliftIO.Internals.Async as I
@@ -449,7 +450,7 @@ pooledReplicateConcurrently_ n f = unsafeEff $ \es -> do
449-- Conc
450-- Conc
450
451
451-- | Lifted 'U.Conc'.
452-- | Lifted 'U.Conc'.
452−data Conc es a where
453+data Conc :: [Effect] -> Type -> Type where
453 Action :: Eff es a -> Conc es a
454 Action :: Eff es a -> Conc es a
454 Apply :: Conc es (v -> a) -> Conc es v -> Conc es a
455 Apply :: Conc es (v -> a) -> Conc es v -> Conc es a
455 LiftA2 :: (x -> y -> a) -> Conc es x -> Conc es y -> Conc es a
456 LiftA2 :: (x -> y -> a) -> Conc es x -> Conc es y -> Conc es a