bluefin 0.0.0.0 → 0.0.1.0
raw patch · 4 files changed
+35/−12 lines, 4 filesdep ~bluefin-internalPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: bluefin-internal
API changes (from Hackage documentation)
+ Bluefin.Writer: data () => Writer w (e :: Effects)
+ Bluefin.Writer: execWriter :: forall w (es :: Effects) r. Monoid w => (forall (e :: Effects). () => Writer w e -> Eff (e :& es) r) -> Eff es w
+ Bluefin.Writer: runWriter :: forall w (es :: Effects) r. Monoid w => (forall (e :: Effects). () => Writer w e -> Eff (e :& es) r) -> Eff es (r, w)
+ Bluefin.Writer: tell :: forall (e :: Effects) (es :: Effects) w. e :> es => Writer w e -> w -> Eff es ()
Files
- CHANGELOG.md +4/−0
- bluefin.cabal +3/−2
- src/Bluefin.hs +11/−10
- src/Bluefin/Writer.hs +17/−0
CHANGELOG.md view
@@ -1,3 +1,7 @@+## 0.0.1.0++* Add `Bluefin.Writer`+ ## 0.0.0.0 * Initial version
bluefin.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: bluefin-version: 0.0.0.0+version: 0.0.1.0 license: MIT license-file: LICENSE author: Tom Ellis@@ -28,7 +28,8 @@ Bluefin.IO, Bluefin.State, Bluefin.Stream,+ Bluefin.Writer, build-depends:- bluefin-internal < 0.1+ bluefin-internal >= 0.0.1 && < 0.1 hs-source-dirs: src default-language: Haskell2010
src/Bluefin.hs view
@@ -124,26 +124,26 @@ -- -- It would be great to share code between the two projects! But -- there are two Bluefin features that I don't know to implement- -- in terms of effectful: 'Bluefin.Bluefin.Coroutine's and- -- 'Bluefin.Bluefin.Compound' effects.+ -- in terms of effectful: "Bluefin.Coroutine"s and+ -- "Bluefin.Compound" effects. -- * Implementation -- | Bluefin has a similar implementation style to effectful.- -- 'Bluefin.Eff.Eff' is an opaque wrapper around 'IO',- -- 'Bluefin.State.State' is an opaque wrapper around+ -- t'Bluefin.Eff.Eff' is an opaque wrapper around 'IO',+ -- t'Bluefin.State.State' is an opaque wrapper around -- 'Data.IORef.IORef', and 'Bluefin.Exception.throw' throws an- -- actual @IO@ exception. 'Bluefin.Coroutine.Coroutine', which+ -- actual @IO@ exception. t'Bluefin.Coroutine.Coroutine', which -- doesn't exist in effectful, is implemented simply as a -- function. -- -- @- -- newtype 'Bluefin.Eff.Eff' (es :: 'Bluefin.Eff.Effects') a = 'Bluefin.Internal.UnsafeMkEff' (IO a)- -- newtype 'Bluefin.State.State' s (st :: Effects) = 'Bluefin.Internal.UnsafeMkState' (IORef s)- -- newtype 'Bluefin.Coroutine.Coroutine' a b (s :: Effects) = 'Bluefin.Internal.UnsafeMkCoroutine' (a -> IO b)+ -- newtype t'Bluefin.Eff.Eff' (es :: 'Bluefin.Eff.Effects') a = 'Bluefin.Internal.UnsafeMkEff' (IO a)+ -- newtype t'Bluefin.State.State' s (st :: Effects) = 'Bluefin.Internal.UnsafeMkState' (IORef s)+ -- newtype t'Bluefin.Coroutine.Coroutine' a b (s :: Effects) = 'Bluefin.Internal.UnsafeMkCoroutine' (a -> IO b) -- @ --- -- The type parameters of kind 'Bluefin.Eff.Effects' are phantom+ -- The type parameters of kind t'Bluefin.Eff.Effects' are phantom -- type parameters which track which effects can be used in an -- operation. Bluefin uses them to ensure that effects cannot -- escape the scope of their handler, in the same way that the@@ -157,7 +157,8 @@ -- * Tips -- | * Use @NoMonoLocalBinds@ and @NoMonomorphismRestriction@ for- -- better type inference.+ -- better type inference. (You can always change back to the+ -- default after adding inferred type signatures.) -- -- * Writing a handler often requires an explicit type signature.
+ src/Bluefin/Writer.hs view
@@ -0,0 +1,17 @@+module Bluefin.Writer+ ( -- | In most cases you'll probably prefer t'Bluefin.Stream.Stream'+ -- to @Writer@, but @Writer@ can still be useful in some cases,+ -- for example with @Data.Monoid.'Data.Monoid.Any'@ to determine+ -- whether an event ever occurred.++ -- * Handle+ Writer,+ -- * Handlers+ runWriter,+ execWriter,+ -- * Effectful operations+ tell,+ )+where++import Bluefin.Internal