git.iko.soy/effects-benchmarks
on master help sign in
Make things work with FE 1.0.
3416436Patrick Thomson
effects-benchmarks.cabal+1−2
@@ -54,7 +54,7 @@ library instances-for-fused-effects
54 exposed-modules: Fused.Stateful
54 exposed-modules: Fused.Stateful
55 , Fused.StatefulExcept
55 , Fused.StatefulExcept
56 , Fused.HTTP
56 , Fused.HTTP
57− build-depends: fused-effects >= 0.5
57+ build-depends: fused-effects > 1 && <1.1
58
58
59library instances-for-freer-simple
59library instances-for-freer-simple
60 import: shared
60 import: shared
@@ -83,7 +83,6 @@ benchmark effects-benchmarks
83 , instances-for-polysemy
83 , instances-for-polysemy
84 , instances-for-shallow
84 , instances-for-shallow
85 , instances-for-exteff
85 , instances-for-exteff
86− , dump-core
87 , gauge
86 , gauge
88 , weigh
87 , weigh
89 , polysemy
88 , polysemy
instances/Fused/HTTP.hs+5−5
@@ -3,10 +3,10 @@
3
3
4module Fused.HTTP where
4module Fused.HTTP where
5
5
6−import Control.Effect
6+import Control.Algebra
7−import Control.Effect.Carrier
8import Control.Monad.IO.Class
7import Control.Monad.IO.Class
9import GHC.Generics (Generic1)
8import GHC.Generics (Generic1)
9+import Control.Carrier.Lift
10
10
11newtype HttpC m a = HttpC { runHttpC :: m a }
11newtype HttpC m a = HttpC { runHttpC :: m a }
12 deriving newtype (Applicative, Functor, Monad, MonadIO)
12 deriving newtype (Applicative, Functor, Monad, MonadIO)
@@ -33,13 +33,13 @@ get' = send (HGet pure)
33
33
34type HttpM = HttpC (LiftC IO)
34type HttpM = HttpC (LiftC IO)
35
35
36−instance (Effect sig, Carrier sig m) => Carrier (HTTP :+: sig) (HttpC m) where
36+instance (Effect sig, Algebra sig m) => Algebra (HTTP :+: sig) (HttpC m) where
37− eff (L act) = case act of
37+ alg (L act) = case act of
38 Open _ k -> k
38 Open _ k -> k
39 Close k -> k
39 Close k -> k
40 Post s k -> k ("posted " <> s)
40 Post s k -> k ("posted " <> s)
41 HGet k -> k "lmao"
41 HGet k -> k "lmao"
42− eff (R other) = HttpC (eff (handleCoercible other))
42+ alg (R other) = HttpC (alg (handleCoercible other))
43
43
44runHttp :: HttpM a -> IO a
44runHttp :: HttpM a -> IO a
45runHttp = runM . runHttpC
45runHttp = runM . runHttpC
instances/Fused/Stateful.hs+3−3
@@ -2,10 +2,10 @@
2
2
3module Fused.Stateful where
3module Fused.Stateful where
4
4
5−import Control.Effect (run, PureC)
6−import Control.Effect.State.Lazy as State
5+import Control.Carrier.State.Lazy as State
6+import Data.Functor.Identity
7
7
8−type StateM = StateC Int PureC
8+type StateM = StateC Int Identity
9
9
10get :: StateM Int
10get :: StateM Int
11get = State.get @Int
11get = State.get @Int
instances/Fused/StatefulExcept.hs+4−4
@@ -2,11 +2,11 @@
2
2
3module Fused.StatefulExcept where
3module Fused.StatefulExcept where
4
4
5−import Control.Effect (run, PureC)
6−import Control.Effect.State.Strict as State
5+import Control.Carrier.State.Strict as State
7−import Control.Effect.Error
6+import Control.Carrier.Error.Either
7+import Data.Functor.Identity
8
8
9−type StateM = StateC Int (ErrorC String PureC)
9+type StateM = StateC Int (ErrorC String Identity)
10
10
11get :: StateM Int
11get :: StateM Int
12get = State.get @Int
12get = State.get @Int