bluefin 0.9.1.0 → 0.10.0.0
raw patch · 13 files changed
+57/−147 lines, 13 filesdep ~bluefin-internalPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: bluefin-internal
API changes (from Hackage documentation)
- Bluefin.Capability.Ask: type Ask = Reader
- Bluefin.Capability.AskCapability: type AskCapability = HandleReader
- Bluefin.Capability.Modify: type Modify = State
- Bluefin.Capability.Request: type Request = Coroutine
- Bluefin.Capability.Tell: type Tell = Writer
- Bluefin.Capability.Throw: type Throw = Exception
- Bluefin.Coroutine: data Coroutine a b (e :: Effects)
- Bluefin.Exception: data Exception exn (e :: Effects)
- Bluefin.HandleReader: data HandleReader (h :: Effects -> Type) (e :: Effects)
- Bluefin.Pipes: (<-<) :: forall (e1 :: Effects) (es :: Effects) b c' c r a' a. e1 <: es => (forall (e :: Effects). () => Proxy () b c' c e -> Eff (e :& es) r) -> (forall (e :: Effects). () => Proxy a' a () b e -> Eff (e :& es) r) -> Proxy a' a c' c e1 -> Eff es r
- Bluefin.Pipes: (<~) :: forall (e1 :: Effects) (es :: Effects) b x' x c' c b' a a'. e1 <: es => (b -> forall (e :: Effects). () => Proxy x' x c' c e -> Eff (e :& es) b') -> (a -> forall (e :: Effects). () => Proxy x' x b' b e -> Eff (e :& es) a') -> a -> Proxy x' x c' c e1 -> Eff es a'
- Bluefin.Pipes: (>->) :: forall (e1 :: Effects) (es :: Effects) a' a b r c' c. e1 <: es => (forall (e :: Effects). () => Proxy a' a () b e -> Eff (e :& es) r) -> (forall (e :: Effects). () => Proxy () b c' c e -> Eff (e :& es) r) -> Proxy a' a c' c e1 -> Eff es r
- Bluefin.Pipes: (>~) :: forall (e1 :: Effects) (es :: Effects) a' a y' y b c. e1 <: es => (forall (e :: Effects). () => Proxy a' a y' y e -> Eff (e :& es) b) -> (forall (e :: Effects). () => Proxy () b y' y e -> Eff (e :& es) c) -> Proxy a' a y' y e1 -> Eff es c
- Bluefin.Pipes: (~<) :: forall (e1 :: Effects) (es :: Effects) b y' y c a' a. e1 <: es => (forall (e :: Effects). () => Proxy () b y' y e -> Eff (e :& es) c) -> (forall (e :: Effects). () => Proxy a' a y' y e -> Eff (e :& es) b) -> Proxy a' a y' y e1 -> Eff es c
- Bluefin.Pipes: (~>) :: forall (e1 :: Effects) (es :: Effects) a x' x b' b a' c' c. e1 <: es => (a -> forall (e :: Effects). () => Proxy x' x b' b e -> Eff (e :& es) a') -> (b -> forall (e :: Effects). () => Proxy x' x c' c e -> Eff (e :& es) b') -> a -> Proxy x' x c' c e1 -> Eff es a'
- Bluefin.Pipes: await :: forall (e :: Effects) (es :: Effects) a y' y. e <: es => Proxy () a y' y e -> Eff es a
- Bluefin.Pipes: cat :: forall a (e :: Effects) (es :: Effects) r. Pipe a a e -> Eff (e :& es) r
- Bluefin.Pipes: data Proxy a' a b' b (e :: Effects)
- Bluefin.Pipes: each :: forall f a x' x (e :: Effects) (es :: Effects). Foldable f => f a -> Proxy x' x () a e -> Eff (e :& es) ()
- Bluefin.Pipes: for :: forall (e1 :: Effects) (es :: Effects) x' x b' b a' c' c. e1 <: es => (forall (e :: Effects). () => Proxy x' x b' b e -> Eff (e :& es) a') -> (b -> forall (e :: Effects). () => Proxy x' x c' c e -> Eff (e :& es) b') -> Proxy x' x c' c e1 -> Eff es a'
- Bluefin.Pipes: infixl 4 <~
- Bluefin.Pipes: infixl 5 >~
- Bluefin.Pipes: infixl 7 >->
- Bluefin.Pipes: infixr 4 ~>
- Bluefin.Pipes: infixr 5 ~<
- Bluefin.Pipes: infixr 7 <-<
- Bluefin.Pipes: next :: ()
- Bluefin.Pipes: runEffect :: forall (es :: Effects) r. (forall (e :: Effects). () => Effect e -> Eff (e :& es) r) -> Eff es r
- Bluefin.Pipes: type Consumer a = Pipe a Void
- Bluefin.Pipes: type Effect = Producer Void
- Bluefin.Pipes: type Pipe a = Proxy () a ()
- Bluefin.Pipes: type Producer = Proxy Void () ()
- Bluefin.Pipes: yield :: forall (e :: Effects) (es :: Effects) x1 x a. e <: es => Proxy x1 x () a e -> a -> Eff es ()
- Bluefin.Pipes.Prelude: drain :: forall (e :: Effects) (es :: Effects) b c' c r. e <: es => Proxy () b c' c e -> Eff es r
- Bluefin.Pipes.Prelude: map :: forall (e :: Effects) (es :: Effects) a b r. e <: es => (a -> b) -> Pipe a b e -> Eff es r
- Bluefin.Pipes.Prelude: mapM :: forall (e :: Effects) (es :: Effects) a b r. e <: es => (a -> Eff es b) -> Pipe a b e -> Eff es r
- Bluefin.Pipes.Prelude: mapM_ :: forall (e :: Effects) (es :: Effects) a b b' r. e <: es => (a -> Eff es ()) -> Proxy () a b b' e -> Eff es r
- Bluefin.Pipes.Prelude: print :: forall (e2 :: Effects) (es :: Effects) (e1 :: Effects) a r. (e2 <: es, e1 <: es, Show a) => IOE e1 -> Consumer a e2 -> Eff es r
- Bluefin.Pipes.Prelude: repeatM :: forall (e :: Effects) (es :: Effects) a x' x r. e <: es => Eff es a -> Proxy x' x () a e -> Eff es r
- Bluefin.Pipes.Prelude: replicateM :: forall (e :: Effects) (es :: Effects) a x' x. e <: es => Int -> Eff es a -> Proxy x' x () a e -> Eff es ()
- Bluefin.Pipes.Prelude: stdinLn :: forall (e1 :: Effects) (es :: Effects) (e2 :: Effects) r. (e1 <: es, e2 <: es) => IOE e1 -> Producer String e2 -> Eff es r
- Bluefin.Pipes.Prelude: stdoutLn :: forall (e1 :: Effects) (es :: Effects) (e2 :: Effects) r. (e1 <: es, e2 <: es) => IOE e1 -> Consumer String e2 -> Eff es r
- Bluefin.Pipes.Prelude: takeWhile' :: forall (e :: Effects) (es :: Effects) r. e <: es => (r -> Bool) -> Pipe r r e -> Eff es r
- Bluefin.Pipes.Prelude: unfoldr :: forall (e :: Effects) (es :: Effects) s r a x1 x. e <: es => (s -> Eff es (Either r (a, s))) -> s -> Proxy x1 x () a e -> Eff es r
- Bluefin.Reader: data Reader r (e :: Effects)
- Bluefin.State: data State s (e :: Effects)
- Bluefin.Writer: data Writer w (e :: Effects)
+ Bluefin.Capability.Ask: data Ask r (e :: Effects)
+ Bluefin.Capability.AskCapability: data AskCapability (h :: Effects -> Type) (e :: Effects)
+ Bluefin.Capability.Modify: data Modify s (e :: Effects)
+ Bluefin.Capability.Request: data Request a b (e :: Effects)
+ Bluefin.Capability.Tell: data Tell w (e :: Effects)
+ Bluefin.Capability.Throw: data Throw exn (e :: Effects)
+ Bluefin.Coroutine: type Coroutine = Request
+ Bluefin.Exception: type Exception = Throw
+ Bluefin.HandleReader: type HandleReader = AskCapability
+ Bluefin.Reader: type Reader = Ask
+ Bluefin.State: type State = Modify
+ Bluefin.Writer: type Writer = Tell
- Bluefin.Capability.Ask: ask :: forall (e :: Effects) (es :: Effects) r. e <: es => Reader r e -> Eff es r
+ Bluefin.Capability.Ask: ask :: forall (e :: Effects) (es :: Effects) r. e <: es => Ask r e -> Eff es r
- Bluefin.Capability.Ask: asks :: forall (e :: Effects) (es :: Effects) r a. e <: es => Reader r e -> (r -> a) -> Eff es a
+ Bluefin.Capability.Ask: asks :: forall (e :: Effects) (es :: Effects) r a. e <: es => Ask r e -> (r -> a) -> Eff es a
- Bluefin.Capability.Ask: local :: forall (e1 :: Effects) (es :: Effects) r a. e1 <: es => Reader r e1 -> (r -> r) -> Eff es a -> Eff es a
+ Bluefin.Capability.Ask: local :: forall (e1 :: Effects) (es :: Effects) r a. e1 <: es => Ask r e1 -> (r -> r) -> Eff es a -> Eff es a
- Bluefin.Capability.AskCapability: askCapability :: forall (e :: Effects) (es :: Effects) h. (e <: es, Handle h) => HandleReader h e -> Eff es (h es)
+ Bluefin.Capability.AskCapability: askCapability :: forall (e :: Effects) (es :: Effects) h. (e <: es, Handle h) => AskCapability h e -> Eff es (h es)
- Bluefin.Capability.AskCapability: runAskCapability :: forall (e1 :: Effects) (es :: Effects) h r. (e1 <: es, Handle h) => h e1 -> (forall (e :: Effects). () => HandleReader h e -> Eff (e :& es) r) -> Eff es r
+ Bluefin.Capability.AskCapability: runAskCapability :: forall (e1 :: Effects) (es :: Effects) h r. (e1 <: es, Handle h) => h e1 -> (forall (e :: Effects). () => AskCapability h e -> Eff (e :& es) r) -> Eff es r
- Bluefin.Capability.Await: await :: forall (e :: Effects) (es :: Effects) a. e <: es => Consume a e -> Eff es a
+ Bluefin.Capability.Await: await :: forall (e :: Effects) (es :: Effects) a. e <: es => Await a e -> Eff es a
- Bluefin.Capability.Await: type Await a = Consume a
+ Bluefin.Capability.Await: type Await a = Request () a
- Bluefin.Capability.JumpTo: jumpTo :: forall (e :: Effects) (es :: Effects) a. e <: es => Jump e -> Eff es a
+ Bluefin.Capability.JumpTo: jumpTo :: forall (e :: Effects) (es :: Effects) a. e <: es => JumpTo e -> Eff es a
- Bluefin.Capability.JumpTo: type JumpTo = Jump
+ Bluefin.Capability.JumpTo: type JumpTo = ReturnEarly ()
- Bluefin.Capability.Modify: get :: forall (e :: Effects) (es :: Effects) s. e <: es => State s e -> Eff es s
+ Bluefin.Capability.Modify: get :: forall (e :: Effects) (es :: Effects) s. e <: es => Modify s e -> Eff es s
- Bluefin.Capability.Modify: modify :: forall (e :: Effects) (es :: Effects) s. e <: es => State s e -> (s -> s) -> Eff es ()
+ Bluefin.Capability.Modify: modify :: forall (e :: Effects) (es :: Effects) s. e <: es => Modify s e -> (s -> s) -> Eff es ()
- Bluefin.Capability.Modify: put :: forall (e :: Effects) (es :: Effects) s. e <: es => State s e -> s -> Eff es ()
+ Bluefin.Capability.Modify: put :: forall (e :: Effects) (es :: Effects) s. e <: es => Modify s e -> s -> Eff es ()
- Bluefin.Capability.Request: forEach :: forall a b (es :: Effects) r. (forall (e1 :: Effects). () => Coroutine a b e1 -> Eff (e1 :& es) r) -> (a -> Eff es b) -> Eff es r
+ Bluefin.Capability.Request: forEach :: forall a b (es :: Effects) r. (forall (e1 :: Effects). () => Request a b e1 -> Eff (e1 :& es) r) -> (a -> Eff es b) -> Eff es r
- Bluefin.Capability.ReturnEarly: returnEarly :: forall (e :: Effects) (es :: Effects) r a. e <: es => EarlyReturn r e -> r -> Eff es a
+ Bluefin.Capability.ReturnEarly: returnEarly :: forall (e :: Effects) (es :: Effects) r a. e <: es => ReturnEarly r e -> r -> Eff es a
- Bluefin.Capability.ReturnEarly: type ReturnEarly = EarlyReturn
+ Bluefin.Capability.ReturnEarly: type ReturnEarly = Throw
- Bluefin.Capability.ReturnEarly: withReturnEarly :: forall r (es :: Effects). (forall (e :: Effects). () => EarlyReturn r e -> Eff (e :& es) r) -> Eff es r
+ Bluefin.Capability.ReturnEarly: withReturnEarly :: forall r (es :: Effects). (forall (e :: Effects). () => ReturnEarly r e -> Eff (e :& es) r) -> Eff es r
- Bluefin.Capability.Tell: tell :: forall (e :: Effects) (es :: Effects) w. e <: es => Writer w e -> w -> Eff es ()
+ Bluefin.Capability.Tell: tell :: forall (e :: Effects) (es :: Effects) w. e <: es => Tell w e -> w -> Eff es ()
- Bluefin.Capability.Throw: catch :: forall exn (es :: Effects) a. (forall (e :: Effects). () => Exception exn e -> Eff (e :& es) a) -> (exn -> Eff es a) -> Eff es a
+ Bluefin.Capability.Throw: catch :: forall exn (es :: Effects) a. (forall (e :: Effects). () => Throw exn e -> Eff (e :& es) a) -> (exn -> Eff es a) -> Eff es a
- Bluefin.Capability.Throw: handle :: forall exn (es :: Effects) a. (exn -> Eff es a) -> (forall (e :: Effects). () => Exception exn e -> Eff (e :& es) a) -> Eff es a
+ Bluefin.Capability.Throw: handle :: forall exn (es :: Effects) a. (exn -> Eff es a) -> (forall (e :: Effects). () => Throw exn e -> Eff (e :& es) a) -> Eff es a
- Bluefin.Capability.Throw: rethrowIO :: forall ex (es :: Effects) (e1 :: Effects) (e2 :: Effects) r. (e1 <: es, e2 <: es, Exception ex) => IOE e1 -> Exception ex e2 -> Eff es r -> Eff es r
+ Bluefin.Capability.Throw: rethrowIO :: forall ex (es :: Effects) (e1 :: Effects) (e2 :: Effects) r. (e1 <: es, e2 <: es, Exception ex) => IOE e1 -> Throw ex e2 -> Eff es r -> Eff es r
- Bluefin.Capability.Throw: throw :: forall (e :: Effects) (es :: Effects) ex a. e <: es => Exception ex e -> ex -> Eff es a
+ Bluefin.Capability.Throw: throw :: forall (e :: Effects) (es :: Effects) ex a. e <: es => Throw ex e -> ex -> Eff es a
- Bluefin.Capability.Throw: try :: forall exn (es :: Effects) a. (forall (e :: Effects). () => Exception exn e -> Eff (e :& es) a) -> Eff es (Either exn a)
+ Bluefin.Capability.Throw: try :: forall exn (es :: Effects) a. (forall (e :: Effects). () => Throw exn e -> Eff (e :& es) a) -> Eff es (Either exn a)
- Bluefin.Capability.Yield: catMaybes :: forall (e2 :: Effects) (es :: Effects) a r. e2 <: es => (forall (e1 :: Effects). () => Stream (Maybe a) e1 -> Eff (e1 :& es) r) -> Stream a e2 -> Eff es r
+ Bluefin.Capability.Yield: catMaybes :: forall (e2 :: Effects) (es :: Effects) a r. e2 <: es => (forall (e1 :: Effects). () => Yield (Maybe a) e1 -> Eff (e1 :& es) r) -> Yield a e2 -> Eff es r
- Bluefin.Capability.Yield: enumerate :: forall (e2 :: Effects) (es :: Effects) a r. e2 <: es => (forall (e1 :: Effects). () => Stream a e1 -> Eff (e1 :& es) r) -> Stream (Int, a) e2 -> Eff es r
+ Bluefin.Capability.Yield: enumerate :: forall (e2 :: Effects) (es :: Effects) a r. e2 <: es => (forall (e1 :: Effects). () => Yield a e1 -> Eff (e1 :& es) r) -> Yield (Int, a) e2 -> Eff es r
- Bluefin.Capability.Yield: enumerateFrom :: forall (e2 :: Effects) (es :: Effects) a r. e2 <: es => Int -> (forall (e1 :: Effects). () => Stream a e1 -> Eff (e1 :& es) r) -> Stream (Int, a) e2 -> Eff es r
+ Bluefin.Capability.Yield: enumerateFrom :: forall (e2 :: Effects) (es :: Effects) a r. e2 <: es => Int -> (forall (e1 :: Effects). () => Yield a e1 -> Eff (e1 :& es) r) -> Yield (Int, a) e2 -> Eff es r
- Bluefin.Capability.Yield: forEach :: forall a b (es :: Effects) r. (forall (e1 :: Effects). () => Coroutine a b e1 -> Eff (e1 :& es) r) -> (a -> Eff es b) -> Eff es r
+ Bluefin.Capability.Yield: forEach :: forall a b (es :: Effects) r. (forall (e1 :: Effects). () => Request a b e1 -> Eff (e1 :& es) r) -> (a -> Eff es b) -> Eff es r
- Bluefin.Capability.Yield: ignoreYield :: forall a (es :: Effects) r. (forall (e1 :: Effects). () => Stream a e1 -> Eff (e1 :& es) r) -> Eff es r
+ Bluefin.Capability.Yield: ignoreYield :: forall a (es :: Effects) r. (forall (e1 :: Effects). () => Yield a e1 -> Eff (e1 :& es) r) -> Eff es r
- Bluefin.Capability.Yield: inFoldable :: forall t (e1 :: Effects) (es :: Effects) a. (Foldable t, e1 <: es) => t a -> Stream a e1 -> Eff es ()
+ Bluefin.Capability.Yield: inFoldable :: forall t (e1 :: Effects) (es :: Effects) a. (Foldable t, e1 <: es) => t a -> Yield a e1 -> Eff es ()
- Bluefin.Capability.Yield: mapMaybe :: forall (e2 :: Effects) (es :: Effects) a b r. e2 <: es => (a -> Maybe b) -> (forall (e1 :: Effects). () => Stream a e1 -> Eff (e1 :& es) r) -> Stream b e2 -> Eff es r
+ Bluefin.Capability.Yield: mapMaybe :: forall (e2 :: Effects) (es :: Effects) a b r. e2 <: es => (a -> Maybe b) -> (forall (e1 :: Effects). () => Yield a e1 -> Eff (e1 :& es) r) -> Yield b e2 -> Eff es r
- Bluefin.Capability.Yield: type Yield a = Stream a
+ Bluefin.Capability.Yield: type Yield a = Request a ()
- Bluefin.Capability.Yield: withYieldToList :: forall a (es :: Effects) r. (forall (e :: Effects). () => Stream a e -> Eff (e :& es) ([a] -> r)) -> Eff es r
+ Bluefin.Capability.Yield: withYieldToList :: forall a (es :: Effects) r. (forall (e :: Effects). () => Yield a e -> Eff (e :& es) ([a] -> r)) -> Eff es r
- Bluefin.Capability.Yield: yield :: forall (e1 :: Effects) (es :: Effects) a. e1 <: es => Stream a e1 -> a -> Eff es ()
+ Bluefin.Capability.Yield: yield :: forall (e1 :: Effects) (es :: Effects) a. e1 <: es => Yield a e1 -> a -> Eff es ()
- Bluefin.Capability.Yield: yieldToList :: forall a (es :: Effects) r. (forall (e1 :: Effects). () => Stream a e1 -> Eff (e1 :& es) r) -> Eff es ([a], r)
+ Bluefin.Capability.Yield: yieldToList :: forall a (es :: Effects) r. (forall (e1 :: Effects). () => Yield a e1 -> Eff (e1 :& es) r) -> Eff es ([a], r)
- Bluefin.Capability.Yield: yieldToReverseList :: forall a (es :: Effects) r. (forall (e :: Effects). () => Stream a e -> Eff (e :& es) r) -> Eff es ([a], r)
+ Bluefin.Capability.Yield: yieldToReverseList :: forall a (es :: Effects) r. (forall (e :: Effects). () => Yield a e -> Eff (e :& es) r) -> Eff es ([a], r)
- Bluefin.Consume: await :: forall (e :: Effects) (es :: Effects) a. e <: es => Consume a e -> Eff es a
+ Bluefin.Consume: await :: forall (e :: Effects) (es :: Effects) a. e <: es => Await a e -> Eff es a
- Bluefin.Consume: type Consume a = Coroutine () a
+ Bluefin.Consume: type Consume a = Await a
- Bluefin.Coroutine: forEach :: forall a b (es :: Effects) r. (forall (e1 :: Effects). () => Coroutine a b e1 -> Eff (e1 :& es) r) -> (a -> Eff es b) -> Eff es r
+ Bluefin.Coroutine: forEach :: forall a b (es :: Effects) r. (forall (e1 :: Effects). () => Request a b e1 -> Eff (e1 :& es) r) -> (a -> Eff es b) -> Eff es r
- Bluefin.EarlyReturn: returnEarly :: forall (e :: Effects) (es :: Effects) r a. e <: es => EarlyReturn r e -> r -> Eff es a
+ Bluefin.EarlyReturn: returnEarly :: forall (e :: Effects) (es :: Effects) r a. e <: es => ReturnEarly r e -> r -> Eff es a
- Bluefin.EarlyReturn: type EarlyReturn = Exception
+ Bluefin.EarlyReturn: type EarlyReturn r = ReturnEarly r
- Bluefin.Eff: withMonadFail :: forall (e :: Effects) (es :: Effects) r. e <: es => Exception String e -> (forall (m :: Type -> Type). MonadFail m => m r) -> Eff es r
+ Bluefin.Eff: withMonadFail :: forall (e :: Effects) (es :: Effects) r. e <: es => Throw String e -> (forall (m :: Type -> Type). MonadFail m => m r) -> Eff es r
- Bluefin.Exception: catch :: forall exn (es :: Effects) a. (forall (e :: Effects). () => Exception exn e -> Eff (e :& es) a) -> (exn -> Eff es a) -> Eff es a
+ Bluefin.Exception: catch :: forall exn (es :: Effects) a. (forall (e :: Effects). () => Throw exn e -> Eff (e :& es) a) -> (exn -> Eff es a) -> Eff es a
- Bluefin.Exception: handle :: forall exn (es :: Effects) a. (exn -> Eff es a) -> (forall (e :: Effects). () => Exception exn e -> Eff (e :& es) a) -> Eff es a
+ Bluefin.Exception: handle :: forall exn (es :: Effects) a. (exn -> Eff es a) -> (forall (e :: Effects). () => Throw exn e -> Eff (e :& es) a) -> Eff es a
- Bluefin.Exception: rethrowIO :: forall ex (es :: Effects) (e1 :: Effects) (e2 :: Effects) r. (e1 <: es, e2 <: es, Exception ex) => IOE e1 -> Exception ex e2 -> Eff es r -> Eff es r
+ Bluefin.Exception: rethrowIO :: forall ex (es :: Effects) (e1 :: Effects) (e2 :: Effects) r. (e1 <: es, e2 <: es, Exception ex) => IOE e1 -> Throw ex e2 -> Eff es r -> Eff es r
- Bluefin.Exception: throw :: forall (e :: Effects) (es :: Effects) ex a. e <: es => Exception ex e -> ex -> Eff es a
+ Bluefin.Exception: throw :: forall (e :: Effects) (es :: Effects) ex a. e <: es => Throw ex e -> ex -> Eff es a
- Bluefin.Exception: try :: forall exn (es :: Effects) a. (forall (e :: Effects). () => Exception exn e -> Eff (e :& es) a) -> Eff es (Either exn a)
+ Bluefin.Exception: try :: forall exn (es :: Effects) a. (forall (e :: Effects). () => Throw exn e -> Eff (e :& es) a) -> Eff es (Either exn a)
- Bluefin.Exception.GeneralBracket: catchWithResource :: forall ex r a (es :: Effects). (r -> ex -> Eff es a) -> MakeExceptions r a (Exception ex) es
+ Bluefin.Exception.GeneralBracket: catchWithResource :: forall ex r a (es :: Effects). (r -> ex -> Eff es a) -> MakeExceptions r a (Throw ex) es
- Bluefin.GadtEffect: interpose :: forall (e1 :: Effects) (es :: Effects) (f :: Effect) r. e1 <: es => (Send f es -> EffectHandler f es) -> HandleReader (Send f) e1 -> Eff es r -> Eff es r
+ Bluefin.GadtEffect: interpose :: forall (e1 :: Effects) (es :: Effects) (f :: Effect) r. e1 <: es => (Send f es -> EffectHandler f es) -> AskCapability (Send f) e1 -> Eff es r -> Eff es r
- Bluefin.IO: rethrowIO :: forall ex (es :: Effects) (e1 :: Effects) (e2 :: Effects) r. (e1 <: es, e2 <: es, Exception ex) => IOE e1 -> Exception ex e2 -> Eff es r -> Eff es r
+ Bluefin.IO: rethrowIO :: forall ex (es :: Effects) (e1 :: Effects) (e2 :: Effects) r. (e1 <: es, e2 <: es, Exception ex) => IOE e1 -> Throw ex e2 -> Eff es r -> Eff es r
- Bluefin.Jump: jumpTo :: forall (e :: Effects) (es :: Effects) a. e <: es => Jump e -> Eff es a
+ Bluefin.Jump: jumpTo :: forall (e :: Effects) (es :: Effects) a. e <: es => JumpTo e -> Eff es a
- Bluefin.Jump: type Jump = EarlyReturn ()
+ Bluefin.Jump: type Jump = JumpTo
- Bluefin.Prim: data Prim (e :: Effects)
+ Bluefin.Prim: data Prim (e1 :: Effects) (e2 :: Effects)
- Bluefin.Prim: primitive :: forall (e1 :: Effects) (es :: Effects) a. e1 <: es => Prim e1 -> (State# (PrimStateEff e1) -> (# State# (PrimStateEff e1), a #)) -> Eff es a
+ Bluefin.Prim: primitive :: forall (e1 :: Effects) (e2 :: Effects) (es :: Effects) a. e2 <: es => Prim e1 e2 -> (State# (PrimStateEff e1) -> (# State# (PrimStateEff e1), a #)) -> Eff es a
- Bluefin.Prim: runPrim :: forall (es :: Effects) r. (forall (e :: Effects). () => Prim e -> Eff (e :& es) r) -> Eff es r
+ Bluefin.Prim: runPrim :: forall (es :: Effects) r. (forall (e :: Effects). () => Prim e e -> Eff (e :& es) r) -> Eff es r
- Bluefin.Reader: ask :: forall (e :: Effects) (es :: Effects) r. e <: es => Reader r e -> Eff es r
+ Bluefin.Reader: ask :: forall (e :: Effects) (es :: Effects) r. e <: es => Ask r e -> Eff es r
- Bluefin.Reader: asks :: forall (e :: Effects) (es :: Effects) r a. e <: es => Reader r e -> (r -> a) -> Eff es a
+ Bluefin.Reader: asks :: forall (e :: Effects) (es :: Effects) r a. e <: es => Ask r e -> (r -> a) -> Eff es a
- Bluefin.Reader: local :: forall (e1 :: Effects) (es :: Effects) r a. e1 <: es => Reader r e1 -> (r -> r) -> Eff es a -> Eff es a
+ Bluefin.Reader: local :: forall (e1 :: Effects) (es :: Effects) r a. e1 <: es => Ask r e1 -> (r -> r) -> Eff es a -> Eff es a
- Bluefin.State: evalState :: forall s (es :: Effects) a. s -> (forall (e :: Effects). () => State s e -> Eff (e :& es) a) -> Eff es a
+ Bluefin.State: evalState :: forall s (es :: Effects) a. s -> (forall (e :: Effects). () => Modify s e -> Eff (e :& es) a) -> Eff es a
- Bluefin.State: get :: forall (e :: Effects) (es :: Effects) s. e <: es => State s e -> Eff es s
+ Bluefin.State: get :: forall (e :: Effects) (es :: Effects) s. e <: es => Modify s e -> Eff es s
- Bluefin.State: modify :: forall (e :: Effects) (es :: Effects) s. e <: es => State s e -> (s -> s) -> Eff es ()
+ Bluefin.State: modify :: forall (e :: Effects) (es :: Effects) s. e <: es => Modify s e -> (s -> s) -> Eff es ()
- Bluefin.State: put :: forall (e :: Effects) (es :: Effects) s. e <: es => State s e -> s -> Eff es ()
+ Bluefin.State: put :: forall (e :: Effects) (es :: Effects) s. e <: es => Modify s e -> s -> Eff es ()
- Bluefin.State: runState :: forall s (es :: Effects) a. s -> (forall (e :: Effects). () => State s e -> Eff (e :& es) a) -> Eff es (a, s)
+ Bluefin.State: runState :: forall s (es :: Effects) a. s -> (forall (e :: Effects). () => Modify s e -> Eff (e :& es) a) -> Eff es (a, s)
- Bluefin.State: withState :: forall s (es :: Effects) a. s -> (forall (e :: Effects). () => State s e -> Eff (e :& es) (s -> a)) -> Eff es a
+ Bluefin.State: withState :: forall s (es :: Effects) a. s -> (forall (e :: Effects). () => Modify s e -> Eff (e :& es) (s -> a)) -> Eff es a
- Bluefin.StateSource: newState :: forall (e :: Effects) (es :: Effects) s. e <: es => StateSource e -> s -> Eff es (State s e)
+ Bluefin.StateSource: newState :: forall (e :: Effects) (es :: Effects) s. e <: es => StateSource e -> s -> Eff es (Modify s e)
- Bluefin.Stream: catMaybes :: forall (e2 :: Effects) (es :: Effects) a r. e2 <: es => (forall (e1 :: Effects). () => Stream (Maybe a) e1 -> Eff (e1 :& es) r) -> Stream a e2 -> Eff es r
+ Bluefin.Stream: catMaybes :: forall (e2 :: Effects) (es :: Effects) a r. e2 <: es => (forall (e1 :: Effects). () => Yield (Maybe a) e1 -> Eff (e1 :& es) r) -> Yield a e2 -> Eff es r
- Bluefin.Stream: cycleToStream :: forall f (e1 :: Effects) (es :: Effects) a. (Foldable f, e1 <: es) => f a -> Stream a e1 -> Eff es ()
+ Bluefin.Stream: cycleToStream :: forall f (e1 :: Effects) (es :: Effects) a. (Foldable f, e1 <: es) => f a -> Yield a e1 -> Eff es ()
- Bluefin.Stream: enumerate :: forall (e2 :: Effects) (es :: Effects) a r. e2 <: es => (forall (e1 :: Effects). () => Stream a e1 -> Eff (e1 :& es) r) -> Stream (Int, a) e2 -> Eff es r
+ Bluefin.Stream: enumerate :: forall (e2 :: Effects) (es :: Effects) a r. e2 <: es => (forall (e1 :: Effects). () => Yield a e1 -> Eff (e1 :& es) r) -> Yield (Int, a) e2 -> Eff es r
- Bluefin.Stream: enumerateFrom :: forall (e2 :: Effects) (es :: Effects) a r. e2 <: es => Int -> (forall (e1 :: Effects). () => Stream a e1 -> Eff (e1 :& es) r) -> Stream (Int, a) e2 -> Eff es r
+ Bluefin.Stream: enumerateFrom :: forall (e2 :: Effects) (es :: Effects) a r. e2 <: es => Int -> (forall (e1 :: Effects). () => Yield a e1 -> Eff (e1 :& es) r) -> Yield (Int, a) e2 -> Eff es r
- Bluefin.Stream: forEach :: forall a b (es :: Effects) r. (forall (e1 :: Effects). () => Coroutine a b e1 -> Eff (e1 :& es) r) -> (a -> Eff es b) -> Eff es r
+ Bluefin.Stream: forEach :: forall a b (es :: Effects) r. (forall (e1 :: Effects). () => Request a b e1 -> Eff (e1 :& es) r) -> (a -> Eff es b) -> Eff es r
- Bluefin.Stream: inFoldable :: forall t (e1 :: Effects) (es :: Effects) a. (Foldable t, e1 <: es) => t a -> Stream a e1 -> Eff es ()
+ Bluefin.Stream: inFoldable :: forall t (e1 :: Effects) (es :: Effects) a. (Foldable t, e1 <: es) => t a -> Yield a e1 -> Eff es ()
- Bluefin.Stream: mapMaybe :: forall (e2 :: Effects) (es :: Effects) a b r. e2 <: es => (a -> Maybe b) -> (forall (e1 :: Effects). () => Stream a e1 -> Eff (e1 :& es) r) -> Stream b e2 -> Eff es r
+ Bluefin.Stream: mapMaybe :: forall (e2 :: Effects) (es :: Effects) a b r. e2 <: es => (a -> Maybe b) -> (forall (e1 :: Effects). () => Yield a e1 -> Eff (e1 :& es) r) -> Yield b e2 -> Eff es r
- Bluefin.Stream: type Stream a = Coroutine a ()
+ Bluefin.Stream: type Stream a = Yield a
- Bluefin.Stream: withYieldToList :: forall a (es :: Effects) r. (forall (e :: Effects). () => Stream a e -> Eff (e :& es) ([a] -> r)) -> Eff es r
+ Bluefin.Stream: withYieldToList :: forall a (es :: Effects) r. (forall (e :: Effects). () => Yield a e -> Eff (e :& es) ([a] -> r)) -> Eff es r
- Bluefin.Stream: yield :: forall (e1 :: Effects) (es :: Effects) a. e1 <: es => Stream a e1 -> a -> Eff es ()
+ Bluefin.Stream: yield :: forall (e1 :: Effects) (es :: Effects) a. e1 <: es => Yield a e1 -> a -> Eff es ()
- Bluefin.Stream: yieldToList :: forall a (es :: Effects) r. (forall (e1 :: Effects). () => Stream a e1 -> Eff (e1 :& es) r) -> Eff es ([a], r)
+ Bluefin.Stream: yieldToList :: forall a (es :: Effects) r. (forall (e1 :: Effects). () => Yield a e1 -> Eff (e1 :& es) r) -> Eff es ([a], r)
- Bluefin.Stream: yieldToReverseList :: forall a (es :: Effects) r. (forall (e :: Effects). () => Stream a e -> Eff (e :& es) r) -> Eff es ([a], r)
+ Bluefin.Stream: yieldToReverseList :: forall a (es :: Effects) r. (forall (e :: Effects). () => Yield a e -> Eff (e :& es) r) -> Eff es ([a], r)
- Bluefin.Writer: tell :: forall (e :: Effects) (es :: Effects) w. e <: es => Writer w e -> w -> Eff es ()
+ Bluefin.Writer: tell :: forall (e :: Effects) (es :: Effects) w. e <: es => Tell w e -> w -> Eff es ()
Files
- CHANGELOG.md +12/−0
- bluefin.cabal +2/−4
- src/Bluefin.hs +2/−2
- src/Bluefin/Capability/Await.hs +1/−1
- src/Bluefin/CloneableHandle.hs +7/−7
- src/Bluefin/Compound.hs +3/−3
- src/Bluefin/DslBuilder.hs +9/−9
- src/Bluefin/GadtEffect.hs +4/−4
- src/Bluefin/HandleReader.hs +3/−1
- src/Bluefin/Pipes.hs +0/−51
- src/Bluefin/Pipes/Prelude.hs +0/−51
- src/Bluefin/Prim.hs +11/−11
- src/Bluefin/StateSource.hs +3/−3
CHANGELOG.md view
@@ -1,3 +1,15 @@+# 0.10.0.0++* Make `Ask`, `AskCapability`, `Await`, `JumpTo`, `Modify`, `Request`,+ `ReturnEarly`, `Tell`, `Throw`, and `Yield` the canonical capability+ types; `Reader`, `HandleReader`, `Consume`, `Jump`, `State`, `Coroutine`,+ `EarlyReturn`, `Writer`, `Exception`, and `Stream` are now type synonyms.++* Move `Bluefin.Pipes` and `Bluefin.Pipes.Prelude` to `bluefin-examples`++* Breaking change: separate `Prim`'s primitive state and capability+ scope type parameters+ # 0.9.1.0 * Add `yieldToPureList`
bluefin.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: bluefin-version: 0.9.1.0+version: 0.10.0.0 license: MIT license-file: LICENSE author: Tom Ellis@@ -46,8 +46,6 @@ Bluefin.HandleReader, Bluefin.IO, Bluefin.Jump,- Bluefin.Pipes,- Bluefin.Pipes.Prelude, Bluefin.Prim, Bluefin.Reader, Bluefin.State,@@ -56,6 +54,6 @@ Bluefin.System.IO, Bluefin.Writer, build-depends:- bluefin-internal >= 0.9.1.0 && < 0.10+ bluefin-internal >= 0.10 && < 0.11 hs-source-dirs: src default-language: Haskell2010
src/Bluefin.hs view
@@ -743,7 +743,7 @@ -- IOE e3 -> -- Eff es () -- incrementReadLine state exception io = do- -- 'Bluefin.Jump.withJump' $ \\break -> 'Control.Monad.forever' $ do+ -- 'Bluefin.Capability.JumpTo.withJumpTo' $ \\break -> 'Control.Monad.forever' $ do -- line <- 'Bluefin.IO.effIO' io getLine -- i <- case 'Text.Read.readMaybe' line of -- Nothing ->@@ -752,7 +752,7 @@ -- pure i -- -- when (i == 0) $- -- 'Bluefin.Jump.jumpTo' break+ -- 'Bluefin.Capability.JumpTo.jumpTo' break -- -- 'Bluefin.Capability.Modify.modify' state (+ i) -- @
src/Bluefin/Capability/Await.hs view
@@ -4,7 +4,7 @@ -- @await@ from Conduit or Pipes. -- -- For information about prompt finalization/resource safety when- -- using Bluefin @Consume@s, see "Bluefin.Coroutine".+ -- using Bluefin @Await@s, see "Bluefin.Capability.Request". -- * Capability Await,
src/Bluefin/CloneableHandle.hs view
@@ -38,28 +38,28 @@ -- -- @ -- example :: IO ()- -- example = 'Bluefin.Eff.runEff' $ \\io -> 'Bluefin.State.evalState' 0 $ \\st -> do- -- r \<- 'Bluefin.Exception.try' $ \\ex -> do+ -- example = 'Bluefin.Eff.runEff' $ \\io -> 'Bluefin.Capability.Modify.evalModify' 0 $ \\st -> do+ -- r \<- 'Bluefin.Capability.Throw.try' $ \\ex -> do -- bluefinRace -- io -- (MkMyHandle ('Bluefin.Handle.mapHandle' ex) (mapHandle st)) -- ( \\_ (MkMyHandle ex' st') -> do- -- 'Bluefin.State.modify' st' (subtract 2000)- -- 'Bluefin.Exception.throw' ex' "Aborting from branch 1"+ -- 'Bluefin.Capability.Modify.modify' st' (subtract 2000)+ -- 'Bluefin.Capability.Throw.throw' ex' "Aborting from branch 1" -- ) -- ( \\_ (MkMyHandle _ st') -> do -- modify st' (+ 3000) -- pure (2 :: Int) -- ) --- -- s <- 'Bluefin.State.get' st+ -- s <- 'Bluefin.Capability.Modify.get' st -- 'Bluefin.IO.effIO' io (print r) -- effIO io (putStrLn ("State started at 0 and was cloned. Now: " <> show s)) -- @ -- -- You can see from the output that the actions were raced as- -- expected, and the @State@ was cloned so that changes to it in- -- the branches of @race@ did not affect the original @State@.+ -- expected, and the @Modify@ capability was cloned so that changes to it+ -- in the branches of @race@ did not affect the original capability. -- -- @ -- -- Run one time (the first thread was faster)
src/Bluefin/Compound.hs view
@@ -490,7 +490,7 @@ -- effectful operations as arguments, by giving the effectful -- operation the effect tag @e'@. Here's an example of a dynamic -- reader effect, and one handler for the effect, which runs it in- -- terms of the existing 'Bluefin.Reader' effect.+ -- terms of the existing 'Bluefin.Capability.Ask' effect. -- -- @ -- data DynamicReader r e = DynamicReader@@ -536,8 +536,8 @@ -- 'useImplIn' -- k -- DynamicReader- -- { askLRImpl = 'Bluefin.Reader.ask' h,- -- localLRImpl = \\f k' -> 'Bluefin.Reader.local' h f ('useImpl' k')+ -- { askLRImpl = 'Bluefin.Capability.Ask.ask' h,+ -- localLRImpl = \\f k' -> 'Bluefin.Capability.Ask.local' h f ('useImpl' k') -- } -- @
src/Bluefin/DslBuilder.hs view
@@ -181,7 +181,7 @@ -- @ArenaH@? It is defined like this: -- -- @- -- data ArenaH e = MkArenaH ('Bluefin.Stream.Stream' RobotEntry e) (Stream ObstacleEntry e)+ -- data ArenaH e = MkArenaH ('Bluefin.Capability.Yield.Yield' RobotEntry e) (Yield ObstacleEntry e) -- deriving t'Bluefin.Compound.Generic' -- deriving t'Bluefin.Compound.Handle' via t'Bluefin.Compound.OneWayCoercibleHandle' ArenaH --@@ -191,7 +191,7 @@ -- -- What does that mean? Well, @ArenaH@ is defined according to one -- of the recipes from "Bluefin.Compound", and gives the ability- -- to yield to a @Stream@ of @RobotEntry@s and a stream of+ -- to yield to a @Yield@ of @RobotEntry@s and a yield of -- @ObstacleEntry@s, i.e. the components that make up an @Arena@. -- The only things we can do with the @ArenaH@ then are to give it -- @RobotEntry@s or @ObstacleEntry@s. How do we get them?@@ -213,7 +213,7 @@ -- @ -- obstacle o coord = -- MkArenaBuilder $ 'dslBuilder' $ \(MkArenaH _ yobstacle) -> do- -- 'Bluefin.Stream.yield' yobstacle (o, coord)+ -- 'Bluefin.Capability.Yield.yield' yobstacle (o, coord) -- @ -- *** @robot@ and @InstructionsBuilder@@@ -244,7 +244,7 @@ -- capability, this time @InstructionsH@: -- -- @- -- data InstructionsH e = MkInstructionsH ('Bluefin.Stream.Stream' Instruction e)+ -- data InstructionsH e = MkInstructionsH ('Bluefin.Capability.Yield.Yield' Instruction e) -- deriving t'Bluefin.Compound.Generic' -- deriving t'Bluefin.Compound.Handle' via t'Bluefin.Compound.OneWayCoercibleHandle' InstructionsH --@@ -256,15 +256,15 @@ -- @Instruction@s, i.e. the type of robot instructions defined -- above and used in @Arena@ via @RobotEntry@. In fact, the job -- of @robot@ is exactly to allow us to define a @RobotEntry@ and- -- yield it to the @Stream RobotEntry@ of @Arena@:+ -- yield it to the @Yield RobotEntry@ of @Arena@: -- -- @ -- robot name coords dir (MkInstructionsBuilder ibuilder) = -- MkArenaBuilder $ 'dslBuilder' $ \\(MkArenaH yrobot _) -> do- -- (insns, ()) \<- 'Bluefin.Stream.yieldToList' $ \\yinsns -> do+ -- (insns, ()) \<- 'Bluefin.Capability.Yield.yieldToList' $ \\yinsns -> do -- 'runDslBuilder' (MkInstructionsH ('Bluefin.Compound.mapHandle' yinsns)) ibuilder --- -- 'Bluefin.Stream.yield' yrobot (name, coords, dir, insns)+ -- 'Bluefin.Capability.Yield.yield' yrobot (name, coords, dir, insns) -- @ -- *** Creating @InstructionsBuilder@s@@ -305,7 +305,7 @@ -- *** Implementing @buildArena@ -- | We're now ready to implement @buildArena@. We create a- -- @Stream RobotEntry@ and a @Stream ObstacleEntry@ to pass to the+ -- @Yield RobotEntry@ and a @Yield ObstacleEntry@ to pass to the -- @MkArenaH@ constructor, and use @runDslBuilder@ to run the -- @ArenaBuilder@ provided. (This is a lot like some of the approaches -- in "Bluefin.Compound".)@@ -313,7 +313,7 @@ -- @ -- buildArena :: ArenaBuilder -> Arena -- buildArena (MkArenaBuilder arenaBuilder) = runPureEff $ do- -- (robots, obstacles) \<- 'Bluefin.Stream.yieldToList' $ \\yrobots -> do+ -- (robots, obstacles) \<- 'Bluefin.Capability.Yield.yieldToList' $ \\yrobots -> do -- (obstacles, ()) \<- yieldToList $ \\yobstacles -> do -- 'runDslBuilder' -- (MkArenaH ('Bluefin.Compound.mapHandle' yrobots) (mapHandle yobstacles))
src/Bluefin/GadtEffect.hs view
@@ -98,7 +98,7 @@ -- forall es e1 e2 r. -- (e1 \<: es, e2 \<: es) => -- t'Bluefin.IO.IOE' e1 ->- -- t'Bluefin.Exception.Exception' t'Control.Exception.IOException' e2 ->+ -- t'Bluefin.Capability.Throw.Throw' t'Control.Exception.IOException' e2 -> -- (forall e. 'Send' FileSystem e -> Eff (e :& es) r) -> -- Eff es r -- runFileSystem io ex = 'interpret' $ \\case@@ -186,7 +186,7 @@ -- augmentOp2Interpose :: -- (e1 \<: es, e2 \<: es) => -- IOE e2 ->- -- t'Bluefin.HandleReader.HandleReader' (Send E) e1 ->+ -- t'Bluefin.Capability.AskCapability.AskCapability' (Send E) e1 -> -- Eff es r -> -- Eff es r -- augmentOp2Interpose io = 'interpose' $ \\fc -> \\case@@ -209,8 +209,8 @@ -- augmentOp2Interpret io fc $ \\fc' -> action fc' -- -- effIO io (putStrLn "-- interpose:")- -- runE io $ \\fc -> 'Bluefin.HandleReader.runHandleReader' fc $ \\hr -> do- -- augmentOp2Interpose io hr $ 'Bluefin.HandleReader.asksHandle' hr action+ -- runE io $ \\fc -> 'Bluefin.Capability.AskCapability.runAskCapability' fc $ \\hr -> do+ -- augmentOp2Interpose io hr $ 'Bluefin.Capability.AskCapability.asksCapability' hr action -- @ -- -- @
src/Bluefin/HandleReader.hs view
@@ -24,9 +24,11 @@ runHandleReader, -- * Effectful operations- askHandle, asksHandle, localHandle,++ -- ** Deprecated+ askHandle, ) where
− src/Bluefin/Pipes.hs
@@ -1,51 +0,0 @@--- | Reimplementation of the @pipes@ (@Pipes@) ecosystem in Bluefin.------ You should not use this module. It will be deprecated and removed--- in future versions.------ This module is just an example of what you can do with Bluefin and--- as such it should be obtained from--- [@bluefin-examples@](https://github.com/tomjaguarpaw/bluefin/tree/master/bluefin-examples)--- if you want it. Instead of using it directly you are recommended--- to use------ * t'Bluefin.Capability.Yield.Yield', 'Bluefin.Capability.Yield.yield'--- * t'Bluefin.Capability.Await.Await', 'Bluefin.Capability.Await.await'--- * 'Bluefin.Capability.Yield.awaitYield'--- * For advanced cases only, t'Bluefin.Capability.Request.Request',--- 'Bluefin.Capability.Request.request' and--- 'Bluefin.Capability.Request.connectRequests'------ See also "Bluefin.Pipes.Prelude".-module Bluefin.Pipes- ( -- * The Proxy handle- Proxy,- Effect,- runEffect,-- -- ** Producers- Producer,- yield,- for,- (~>),- (<~),-- -- ** Consumers- Consumer,- await,- (>~),- (~<),-- -- ** Pipes- Pipe,- cat,- (>->),- (<-<),-- -- * Utilities- next,- each,- )-where--import Bluefin.Internal.Pipes
− src/Bluefin/Pipes/Prelude.hs
@@ -1,51 +0,0 @@--- | Reimplementation of the @pipes@ (@Pipes@) ecosystem in Bluefin.------ You should not use this module. It will be deprecated and removed--- in future versions.------ This module is just an example of what you can do with Bluefin and--- as such it should be obtained from--- [@bluefin-examples@](https://github.com/tomjaguarpaw/bluefin/tree/master/bluefin-examples)--- if you want it. Instead of using it directly you are recommended--- to use------ * t'Bluefin.Capability.Yield.Yield', 'Bluefin.Capability.Yield.yield'--- * t'Bluefin.Capability.Await.Await', 'Bluefin.Capability.Await.await'--- * 'Bluefin.Capability.Yield.awaitYield'--- * For advanced cases only, t'Bluefin.Capability.Request.Request',--- 'Bluefin.Capability.Request.request' and--- 'Bluefin.Capability.Request.connectRequests'------ See also "Bluefin.Pipes".------ @--- >>> 'Bluefin.Eff.runEff' $ \\io -> 'runEffect' $ do--- 'stdinLn' io >-> 'takeWhile'' (/= "quit") >-> 'stdoutLn' io--- Test--- Test--- ABC--- ABC--- quit--- "quit"--- @-module Bluefin.Pipes.Prelude- ( -- * Producers- stdinLn,- repeatM,- replicateM,- unfoldr,-- -- * Consumers- stdoutLn,- mapM_,- print,- drain,-- -- * Pipes- map,- mapM,- takeWhile',- )-where--import Bluefin.Internal.Pipes
src/Bluefin/Prim.hs view
@@ -2,33 +2,33 @@ -- -- @ -- -- Define a capability which includes Prim--- data ExAndPrim e = MkExAndPrim (Exception String e) (P.Prim e)+-- data ExAndPrim e1 e2 = MkExAndPrim (Throw String e2) (P.Prim e1 e2) -- -- Give it a Handle instance, as per Bluefin.Compound--- deriving (Handle) via OneWayCoercibleHandle ExAndPrim+-- deriving (Handle) via OneWayCoercibleHandle (ExAndPrim e1) -- deriving stock (Generic) ----- instance (e \<: es) => OneWayCoercible (ExAndPrim e) (ExAndPrim es) where+-- instance (e2 \<: es) => OneWayCoercible (ExAndPrim e1 e2) (ExAndPrim e1 es) where -- oneWayCoercibleImpl = gOneWayCoercible -- -- -- Define a monad M containing the Prim capability--- newtype M e es a = MkM (ReaderT (ExAndPrim e) (Eff es) a)+-- newtype M e a = MkM (DslBuilder (ExAndPrim e) a) -- deriving newtype (Functor, Applicative, Monad) -- -- -- Define a way of running M -- runM :: -- (e1 \<: es, e2 \<: es) =>--- Exception String e1 ->--- P.Prim e2 ->--- M es es r ->+-- Throw String e1 ->+-- P.Prim e e2 ->+-- M e r -> -- Eff es r -- runM ex prim (MkM m) =--- runReaderT m (MkExAndPrim (mapHandle ex) (mapHandle prim))+-- runDslBuilder (MkExAndPrim (mapHandle ex) (mapHandle prim)) m -- -- -- Give M a PrimMonad instance--- instance (e \<: es) => PrimMonad (M e es) where--- type PrimState (M e es) = P.PrimStateEff e+-- instance PrimMonad (M e) where+-- type PrimState (M e) = P.PrimStateEff e -- primitive f =--- MkM (ReaderT (\\(MkExAndPrim _ prim) -> P.'primitive' prim f))+-- MkM (dslBuilder (\\(MkExAndPrim _ prim) -> P.'primitive' prim f)) -- -- -- ghci> example -- -- Right [\"Hello\",\"World\"]
src/Bluefin/StateSource.hs view
@@ -1,9 +1,9 @@ module Bluefin.StateSource ( -- | A 'StateSource' allows you to allocate new- -- t'Bluefin.State.State' handles, much like t'Control.Monad.ST'+ -- t'Bluefin.Capability.Modify.Modify' handles, much like t'Control.Monad.ST' -- allows you to allocate new 'Data.STRef.STRef's. This can be- -- useful when you want to avoid nested 'Bluefin.State.runState'- -- (or `Bluefin.State.evalState') blocks, or you need a number+ -- useful when you want to avoid nested 'Bluefin.Capability.Modify.runModify'+ -- (or `Bluefin.Capability.Modify.evalModify') blocks, or you need a number -- of mutable states that is only dynamically known. -- * Handle