packages feed

creatur 5.9.7 → 5.9.8

raw patch · 2 files changed

+11/−7 lines, 2 filesdep +exceptionsPVP ok

version bump matches the API change (PVP)

Dependencies added: exceptions

API changes (from Hackage documentation)

Files

creatur.cabal view
@@ -1,5 +1,5 @@ Name:              creatur-Version:           5.9.7+Version:           5.9.8 Stability:         experimental Synopsis:          Framework for artificial life experiments. Description:       A software framework for automating experiments@@ -36,7 +36,7 @@ source-repository this   type:     git   location: https://github.com/mhwombat/creatur.git-  tag:      5.9.7+  tag:      5.9.8  library   GHC-Options:      -Wall -fno-warn-orphans@@ -75,6 +75,7 @@                     cond ==0.4.*,                     cereal ==0.4.*,                     directory ==1.2.*,+                    exceptions ==0.8.*,                     filepath ==1.4.*,                     gray-extended ==1.*,                     hdaemonize ==0.5.*,
src/ALife/Creatur/Task.hs view
@@ -9,7 +9,7 @@ -- -- Provides tasks that you can use with a daemon. These tasks handle -- reading and writing agents, and various other housekeeping chores,--- which reduces the amount of code you need to write. +-- which reduces the amount of code you need to write. -- -- It’s also easy to write your own tasks, using these as a guide.) --@@ -41,6 +41,7 @@ import Control.Conditional (whenM) import Control.Exception (SomeException) import Control.Monad (when)+import qualified Control.Monad.Catch as C import Control.Monad.State (StateT, execStateT, evalStateT) import Control.Monad.Trans.Class (lift) import Data.Serialize (Serialize)@@ -79,9 +80,10 @@   as <- lineup   when (not . null $ as) $ do     let a = head as+    C.onException+      (withAgent agentProgram a)+      (writeToLog "Continuing after exception")     markDone a-    -- do that first in case the next line triggers an exception-    withAgent agentProgram a     atEndOfRound endRoundProgram  --   The input parameter is a list of agents. The first agent in the@@ -101,9 +103,10 @@     endRoundProgram = do   atStartOfRound startRoundProgram   as <- lineup+  C.onException+    (withAgents agentsProgram as)+    (writeToLog "Continuing after exception")   markDone (head as)-  -- do that first in case the next line triggers an exception-  withAgents agentsProgram as   atEndOfRound endRoundProgram  checkPopSize :: Universe u => (Int, Int) -> StateT u IO ()