antisplice 0.17.0.3 → 0.17.1.0
raw patch · 5 files changed
+35/−5 lines, 5 filesdep ~basedep ~chattydep ~mtlPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, chatty, mtl, template-haskell, text, time, transformers
API changes (from Hackage documentation)
+ Game.Antisplice.Monad.Dungeon: instance (Functor m, Monad m) => Applicative (DungeonT m)
+ Game.Antisplice.Monad.Dungeon: instance (Functor m, Monad m) => Applicative (ObjectT m)
+ Game.Antisplice.Monad.Dungeon: instance (Functor m, Monad m) => Applicative (PlayerT m)
+ Game.Antisplice.Monad.Dungeon: instance (Functor m, Monad m) => Applicative (RoomT m)
+ Game.Antisplice.Monad.Vocab: instance (Functor m, Monad m) => Applicative (VocabT m)
+ Game.Antisplice.Stereos: instance (Functor m, Monad m) => Applicative (StereoBuilderT m)
- Game.Antisplice.Terminal.Repl: repl :: (ChExtendedPrinter m, ChScanner m, MonadError SplErr m, MonadIO m, ChExpand m, ChExpanderEnv m, MonadDungeon m, ChAtoms m, MonadRoom m, ChClock m, MonadVocab m, ChHistoryEnv m, ChRandom m, ChBroadcaster PlayerId m) => m ()
+ Game.Antisplice.Terminal.Repl: repl :: (Applicative m, ChExtendedPrinter m, ChScanner m, MonadError SplErr m, MonadIO m, ChExpand m, ChExpanderEnv m, MonadDungeon m, ChAtoms m, MonadRoom m, ChClock m, MonadVocab m, ChHistoryEnv m, ChRandom m, ChBroadcaster PlayerId m) => m ()
Files
- antisplice.cabal +4/−2
- src/Game/Antisplice/Monad/Dungeon.hs +19/−2
- src/Game/Antisplice/Monad/Vocab.hs +5/−0
- src/Game/Antisplice/Stereos.hs +5/−0
- src/Game/Antisplice/Terminal/Repl.hs +2/−1
antisplice.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.17.0.3+version: 0.17.1.0 -- A short (one-line) description of the package. synopsis: An engine for text-based dungeons.@@ -31,6 +31,8 @@ -- patches. maintainer: marvin.cohrs@gmx.net +homepage: http://doomanddarkness.eu/pub/antisplice+ -- A copyright notice. -- copyright: @@ -57,7 +59,7 @@ other-extensions: TemplateHaskell, QuasiQuotes, FlexibleInstances, MultiParamTypeClasses, TypeSynonymInstances, FlexibleContexts, UndecidableInstances, RankNTypes, TypeFamilies, FunctionalDependencies, LambdaCase, ScopedTypeVariables, ExistentialQuantification, TupleSections, RecordWildCards, DeriveDataTypeable -- Other library packages from which modules are imported.- build-depends: base >=4.6 && <4.8, chatty >=0.6 && <0.7, chatty-utils >= 0.7 && <0.8, text >=1.1 && <1.2, template-haskell >=2.8 && <2.10, mtl >=2.1 && <2.2, transformers >=0.3 && <0.4, haskeline >= 0.7 && < 0.8, time >= 1.4 && < 1.5+ build-depends: base >=4.6 && <4.9, chatty >=0.6.4 && <0.7, chatty-utils >= 0.7 && <0.8, text >=1.1 && <1.4, template-haskell >=2.8 && <2.11, mtl >=2.1 && <2.3, transformers >=0.3 && <0.5, haskeline >= 0.7 && < 0.8, time >= 1.4 && < 1.6 -- Directories containing source files. hs-source-dirs: src
src/Game/Antisplice/Monad/Dungeon.hs view
@@ -97,6 +97,7 @@ import Data.Chatty.Focus import Data.Chatty.Hetero import Game.Antisplice.Monad.Vocab+import Control.Applicative import Control.Arrow import Control.Monad.Error import Control.Monad.Trans.Class@@ -109,11 +110,11 @@ -- | Matches any 'SomeDungeon' context type DungeonM a = forall m.SomeDungeon m => m a -- | Wrap up 'MonadDungeon', 'MonadError' 'SplErr' and 'MonadVocab' to a single constraint.-type SomeDungeon m = (MonadDungeon m,MonadError SplErr m,MonadVocab m)+type SomeDungeon m = (Applicative m,MonadDungeon m,MonadError SplErr m,MonadVocab m) -- | Matches any 'SomeChattyDungeon' context type ChattyDungeonM a = forall m.SomeChattyDungeon m => m a -- | Wrap up 'SomeDungeon', most Chatty classes and some utility classes to a single sonstraint.-type SomeChattyDungeon m = (Functor m,ChExtendedPrinter m,ChExpand m,ChExpanderEnv m,ChAtoms m,ChClock m,SomeDungeon m,ChRandom m,ChBroadcaster PlayerId m)+type SomeChattyDungeon m = (ChExtendedPrinter m,ChExpand m,ChExpanderEnv m,ChAtoms m,ChClock m,SomeDungeon m,ChRandom m,ChBroadcaster PlayerId m) -- | The common type of all event handlers. type Handler = ChattyDungeonM () -- | A boxed 'Handler' to avoid ImpredicativeTypes@@ -183,6 +184,10 @@ return a = Room $ \s -> return (a,s) m >>= f = Room $ \s -> do (a,s') <- runRoomT m s; runRoomT (f a) s' +instance (Functor m, Monad m) => Applicative (RoomT m) where+ (<*>) = ap+ pure = return+ instance MonadTrans RoomT where lift m = Room $ \s -> do a <- m; return (a,s) @@ -333,6 +338,10 @@ return a = Object $ \s -> return (a,s) m >>= f = Object $ \s -> do (a,s') <- runObjectT m s; runObjectT (f a) s' +instance (Functor m, Monad m) => Applicative (ObjectT m) where+ (<*>) = ap+ pure = return+ instance MonadTrans ObjectT where lift m = Object $ \s -> do a <- m; return (a,s) @@ -438,6 +447,10 @@ return a = Player $ \s -> return (a,s) m >>= f = Player $ \s -> do (a,s') <- runPlayerT m s; runPlayerT (f a) s' +instance (Functor m, Monad m) => Applicative (PlayerT m) where+ (<*>) = ap+ pure = return+ instance MonadTrans PlayerT where lift m = Player $ \s -> do a <- m; return (a,s) @@ -499,6 +512,10 @@ instance Monad m => Monad (DungeonT m) where return a = Dungeon $ \s -> return (a,s) m >>= f = Dungeon $ \s -> do (a,s') <- runDungeonT m s; runDungeonT (f a) s'++instance (Functor m, Monad m) => Applicative (DungeonT m) where+ pure = return+ (<*>) = ap instance MonadTrans DungeonT where lift m = Dungeon $ \s -> do a <- m; return (a,s)
src/Game/Antisplice/Monad/Vocab.hs view
@@ -25,6 +25,7 @@ -- reproduces it later. module Game.Antisplice.Monad.Vocab where +import Control.Applicative import Control.Arrow import Control.Monad import Control.Monad.IO.Class@@ -67,6 +68,10 @@ instance Functor m => Functor (VocabT m) where fmap f a = Vocab $ \s -> fmap (first f) $ runVocabT a s++instance (Functor m, Monad m) => Applicative (VocabT m) where+ (<*>) = ap+ pure = return instance Monad m => Monad (VocabT m) where return a = Vocab $ \s -> return (a,s)
src/Game/Antisplice/Stereos.hs view
@@ -47,6 +47,7 @@ consumeStereo ) where +import Control.Applicative import Control.Monad import Control.Monad.Trans.Class import Control.Monad.Error.Class@@ -116,6 +117,10 @@ instance Monad m => Monad (StereoBuilderT m) where return a = StereoBuilder $ \s -> return (a,s) m >>= f = StereoBuilder $ \s -> do (a,s') <- runStereoBuilderT m s; runStereoBuilderT (f a) s'++instance (Functor m, Monad m) => Applicative (StereoBuilderT m) where+ pure = return+ (<*>) = ap instance MonadTrans StereoBuilderT where lift m = StereoBuilder $ \s -> do a <- m; return (a,s)
src/Game/Antisplice/Terminal/Repl.hs view
@@ -43,6 +43,7 @@ import Data.Chatty.AVL import Data.Chatty.BST import Data.Chatty.Atoms+import Control.Applicative import Control.Monad import Control.Concurrent import Control.Concurrent.MVar@@ -53,7 +54,7 @@ import System.Console.Haskeline.History -- | Read Eval Print Loop for Antisplice.-repl :: (ChExtendedPrinter m,ChScanner m,MonadError SplErr m,MonadIO m,ChExpand m,ChExpanderEnv m,MonadDungeon m,ChAtoms m,MonadRoom m,ChClock m,MonadVocab m,ChHistoryEnv m,ChRandom m,ChBroadcaster PlayerId m) => m ()+repl :: (Applicative m,ChExtendedPrinter m,ChScanner m,MonadError SplErr m,MonadIO m,ChExpand m,ChExpanderEnv m,MonadDungeon m,ChAtoms m,MonadRoom m,ChClock m,MonadVocab m,ChHistoryEnv m,ChRandom m,ChBroadcaster PlayerId m) => m () repl = do mv <- liftIO (newEmptyMVar :: IO (MVar (Maybe String))) cont <- liftIO (newEmptyMVar :: IO (MVar String))