From 97cd74b1999d2eb9136625207a53767e86d3f097 Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Sun, 8 Sep 2024 17:49:52 +0100 Subject: [PATCH] runBluefin and runPureBluefin --- bluefin-internal/src/Bluefin/Internal/Effectful.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bluefin-internal/src/Bluefin/Internal/Effectful.hs b/bluefin-internal/src/Bluefin/Internal/Effectful.hs index e99fb98..20a7bc3 100644 --- a/bluefin-internal/src/Bluefin/Internal/Effectful.hs +++ b/bluefin-internal/src/Bluefin/Internal/Effectful.hs @@ -87,6 +87,17 @@ runPureEffectful :: Eff es r runPureEffectful k = pure (Effectful.runPureEff (unsafeToEffectful k)) +runBluefin :: + Effectful.IOE Effectful.:> effes => + (forall e es. IOE e -> Effectful.Eff (Bluefin (e :& es) : effes) r) -> + Effectful.Eff effes r +runBluefin m = unsafeInterpretBluefin (m MkIOE) + +runPureBluefin :: + (forall es. Effectful.Eff (Bluefin es : effes) r) -> + Effectful.Eff effes r +runPureBluefin = unsafeInterpretBluefin + example :: ( St.State Int Effectful.:> es, Er.Error String Effectful.:> es,