packages feed

hfiar 2.0.2 → 2.0.3

raw patch · 2 files changed

+6/−3 lines, 2 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- HFiaR: tryDropIn :: (Monad m) => Int -> HFiaRT m (Either HFiaRError Game)
+ HFiaR: tryDropIn :: (Monad m) => [Int] -> HFiaRT m (Either HFiaRError Game)

Files

hfiar.cabal view
@@ -1,5 +1,5 @@ name: hfiar-version: 2.0.2+version: 2.0.3 cabal-version: >=1.6 build-type: Custom license: BSD3
src/HFiaR.hs view
@@ -82,8 +82,11 @@                     Right newGame -> put newGame >>= return . Right  -- | Try (i.e. without actually doing it, returns the result of) dropping a tile in a column-tryDropIn :: Monad m => Int -> HFiaRT m (Either HFiaRError Game)-tryDropIn c = get >>= return . doDropIn c+tryDropIn :: Monad m => [Int] -> HFiaRT m (Either HFiaRError Game)+tryDropIn cols = get >>= return . tryDropIn' cols . Right+    where tryDropIn' [] res = res+          tryDropIn' _ (Left err) = Left err+          tryDropIn' (c:cs) (Right g) = tryDropIn' cs $ doDropIn c g  doDropIn :: Int -> Game -> Either HFiaRError Game doDropIn _ Ended{} = Left GameEnded