@@ -3,10 +3,10 @@
33
44module Fused.HTTP where
55
6−import Control.Effect
7−import Control.Effect.Carrier
6+import Control.Algebra
87import Control.Monad.IO.Class
98import GHC.Generics (Generic1)
9+import Control.Carrier.Lift
1010
1111newtype HttpC m a = HttpC { runHttpC :: m a }
1212 deriving newtype (Applicative, Functor, Monad, MonadIO)
@@ -33,13 +33,13 @@ get' = send (HGet pure)
3333
3434type HttpM = HttpC (LiftC IO)
3535
36−instance (Effect sig, Carrier sig m) => Carrier (HTTP :+: sig) (HttpC m) where
37− eff (L act) = case act of
36+instance (Effect sig, Algebra sig m) => Algebra (HTTP :+: sig) (HttpC m) where
37+ alg (L act) = case act of
3838 Open _ k -> k
3939 Close k -> k
4040 Post s k -> k ("posted " <> s)
4141 HGet k -> k "lmao"
42− eff (R other) = HttpC (eff (handleCoercible other))
42+ alg (R other) = HttpC (alg (handleCoercible other))
4343
4444runHttp :: HttpM a -> IO a
4545runHttp = runM . runHttpC