| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Dovin.V2
Description
V2 makes the following changes from V1:
- withLocation now only takes a Location, using the current actor for player.
- Flips argument order for
validatefunctions to be consistent with rest of API. activateandtriggeruse the stack.- Fork has a saner API and reports properly.
formatternow takes aSteprather than anInt.viewis re-exported since it will virtually always be required for normal formatters.
Synopsis
- triggerMentor :: CardName -> CardName -> ExceptT String (ReaderT Env (StateT Board (WriterT [Step] Identity))) ()
- gainLife :: Player -> Int -> GameMonad ()
- loseLife :: Player -> Int -> GameMonad ()
- setLife :: Player -> Int -> GameMonad ()
- run :: (Step -> Formatter) -> GameMonad () -> IO ()
- module Dovin.Actions
- module Dovin.Attributes
- module Dovin.Builder
- module Dovin.Formatting
- module Dovin.Helpers
- module Dovin.Types
- view :: MonadReader s m => Getting a s a -> m a
Documentation
triggerMentor :: CardName -> CardName -> ExceptT String (ReaderT Env (StateT Board (WriterT [Step] Identity))) () Source #
module Dovin.Actions
module Dovin.Attributes
module Dovin.Builder
module Dovin.Formatting
module Dovin.Helpers
module Dovin.Types
view :: MonadReader s m => Getting a s a -> m a #
View the value pointed to by a Getter, Iso or
Lens or the result of folding over all the results of a
Fold or Traversal that points
at a monoidal value.
view.to≡id
>>>view (to f) af a
>>>view _2 (1,"hello")"hello"
>>>view (to succ) 56
>>>view (_2._1) ("hello",("world","!!!"))"world"
As view is commonly used to access the target of a Getter or obtain a monoidal summary of the targets of a Fold,
It may be useful to think of it as having one of these more restricted signatures:
view::Getters a -> s -> aview::Monoidm =>Folds m -> s -> mview::Iso's a -> s -> aview::Lens's a -> s -> aview::Monoidm =>Traversal's m -> s -> m
In a more general setting, such as when working with a Monad transformer stack you can use:
view::MonadReaders m =>Getters a -> m aview:: (MonadReaders m,Monoida) =>Folds a -> m aview::MonadReaders m =>Iso's a -> m aview::MonadReaders m =>Lens's a -> m aview:: (MonadReaders m,Monoida) =>Traversal's a -> m a