eve 0.1.8 → 0.1.9.0
raw patch · 4 files changed
+20/−9 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Eve.Internal.Actions: instance (GHC.Base.Semigroup a, GHC.Base.Monad m) => GHC.Base.Semigroup (Eve.Internal.Actions.ActionT base zoomed m a)
- Eve.Internal.Actions: RunApp :: (StateT base m next) -> AppF base m next
+ Eve.Internal.Actions: RunApp :: StateT base m next -> AppF base m next
Files
- README.md +5/−0
- eve.cabal +1/−1
- src/Eve/Internal/Actions.hs +11/−7
- src/Eve/Internal/AppState.hs +3/−1
README.md view
@@ -205,3 +205,8 @@ Chatting about features is a key part of Eve's development; come join us in the [Chat Room](https://gitter.im/eve-framework/Lobby) to discuss features or improvements!++Related Works+=============++- [Emulating traditional imperative event loops with functional paradigms](./paper/functional-event-loops.pdf)
eve.cabal view
@@ -1,5 +1,5 @@ name: eve-version: 0.1.8+version: 0.1.9.0 synopsis: An extensible event framework description: An extensible event-driven application framework in haskell for building embarassingly modular software. homepage: https://github.com/ChrisPenner/eve#readme
src/Eve/Internal/Actions.hs view
@@ -27,6 +27,7 @@ import Control.Lens import Data.Typeable import Data.Default+import Data.Semigroup -- | An 'App' has the same base and zoomed values. type AppT s m a = ActionT s s m a@@ -42,13 +43,16 @@ { getAction :: FreeT (AppF base m) (StateT zoomed m) a } deriving (Functor, Applicative, Monad, MonadIO, MonadState zoomed) -instance (Monoid a, Monad m) => Monoid (ActionT base zoomed m a) where- mempty = return mempty- a `mappend` b = do+instance (Semigroup a,Monad m) => Semigroup (ActionT base zoomed m a) where+ a <> b = do a' <- a b' <- b- return $ a' `mappend` b'+ return $ a' <> b' +instance (Monoid a, Monad m) => Monoid (ActionT base zoomed m a) where+ mempty = return mempty+ mappend = (<>)+ instance Monad n => MonadFree (AppF base n) (ActionT base zoomed n) where wrap (RunApp act) = join . ActionT . liftF . RunApp $ act @@ -68,10 +72,10 @@ instance Monad m => Zoom (ActionT base s m) (ActionT base t m) s t where zoom l (ActionT action) = ActionT $ zoom l action --- | This runs an `Action MyState a` over the MyState which is+-- | This runs an @'Action' MyState a@ over the MyState which is -- stored in the currently focused state and returns the result.--- Use 'runActionOver' if you'd like to specify a particular MyState--- which is accessed by a Lens or Traversal.+-- Use 'runActionOver' if you'd like to specify a particular @MyState@+-- which is accessed by a 'Lens' or 'Traversal'. runAction :: (HasStates t, Functor (Zoomed m c), Default s, Typeable s, Zoom m n s t) => m c -> n c runAction = zoom stateLens
src/Eve/Internal/AppState.hs view
@@ -71,7 +71,9 @@ -- 'runAction'. For example an 'Action' which operates over a String somewhere in your app state -- would be written as: ----- > alterString :: 'Action' String ()+-- @+-- alterString :: 'Action' String ()+-- @ type Action state a = ActionT AppState state IO a -- | A more general version of 'App' which lets you specify the underlying monad.