packages feed

hfiar 0.1.2 → 1.0.0

raw patch · 2 files changed

+18/−3 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ HFiaR: justEval :: HFiaR a -> a
+ HFiaR: justPlay :: HFiaR a -> Game
+ HFiaR: type HFiaR = HFiaRT Maybe

Files

hfiar.cabal view
@@ -1,12 +1,12 @@ name: hfiar-version: 0.1.2+version: 1.0.0 cabal-version: >=1.6 build-type: Custom license: BSD3 license-file: LICENSE copyright: 2010 Fernando "Brujo" Benavides maintainer: greenmellon@gmail.com-stability: provisional+stability: stable homepage: http://github.com/elbrujohalcon/hfiar package-url: http://code.haskell.org/hfiar bug-reports: http://github.com/elbrujohalcon/hfiar/issues
src/HFiaR.hs view
@@ -1,7 +1,9 @@ -- | This module defines the HFiaR monad and all the actions you can perform in it module HFiaR (--- * Monad controls+-- * MonadTrans controls     HFiaRT, play, eval,+-- * Monad controls+    HFiaR, justPlay, justEval, -- * Types     Game, Player, Tile(..), HFiaRError(..), HFiaRResult(..), -- * Actions@@ -50,9 +52,22 @@     get = HFT $ get     put = HFT . put +-- | Basic HFiaR type - ready to /just/ play HFiaR actions+type HFiaR = HFiaRT Maybe++-- | Starts a game, run the /HFiaRT/ actions and returns the game+justPlay :: HFiaR a -> Game+justPlay actions = let Just r = play actions in r ++-- | Starts a game, run the /HFiaRT/ actions and returns the result of the last one+justEval :: HFiaR a -> a+justEval actions = let Just r = eval actions in r++-- | Starts a game, run the /HFiaRT/ actions and returns the game wrapped up in the /m/ monad play :: Monad m => HFiaRT m a -> m Game play actions = (state actions) `execStateT` (OnCourse (Pl Green) (replicate 7 [])) +-- | Starts a game, run the /HFiaRT/ actions and returns the result of the last one wrapped up in the /m/ monad eval :: Monad m => HFiaRT m a -> m a eval actions = (state actions) `evalStateT` (OnCourse (Pl Green) (replicate 7 []))