!^JBe      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi j k l m n o p q r s t u v w x y z { | } ~        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd(c) Amy de Buitlir 2012-2018 BSD-styleamy@nualeargais.ie experimentalportableNone<FT$creatur%The work to be performed by a daemon.creatur!Operations to perform on startup.creatur"Operations to perform on shutdown.creatur-Operations to perform if an exception occurs. creatur/Operations to perform repeatedly while running. creatur7Number of microseconds to sleep between invocations of  . creaturRCreates a simple daemon to run a job. The daemon will run under the login name. creatur  daemon state! creates a daemon, which invokes daemon. *Note:* If user (in ) is Just ""2, the daemon will run under the login name. If user` is Nothing, the daemon will run under the name of the executable file containing the daemon.   (c) Amy de Buitlir 2012-2018 BSD-styleamy@nualeargais.ie experimentalportableNone<>FT+ creatur6A database offering storage and retrieval for records.creatur.Get a list of all active keys in the database.creatur4Return the number of records stored in the database.creatur~Get a list of all archived keys in the database. If the database does not implement archiving, it may return an empty list.creatur(Read an active record from the database.creatur*Read an archived record from the database.creatur+Fetch all active records from the database.creatur,Read all archived records from the database.creaturjWrite a record to the database. If an agent with the same name already exists, it will be overwritten.creaturhRemove a record from the database. The database may archive records rather than simply deleting them.(c) Amy de Buitlir 2013-2018 BSD-styleamy@nualeargais.ie experimentalportableSafe 67;<=FST3&creaturAnalyses a genetic sequence. creatur(Sums: encode choice between constructors!creatur*Meta-information (constructor names, etc.)"creatur8Constants, additional parameters and recursion of kind *#creatur-Unit: used for constructors without arguments,creatur3Products: encode multiple arguments to constructors(c) Amy de Buitlir 2013-2018 BSD-styleamy@nualeargais.ie experimentalportableSafe 67;<=FSTA-creaturA diploid agent has two complete sets of genetic instructions. Instances of this class can be thought of as paired genes or paired instructions for building an agent. When two instructions in a pair differ,  dominance2 relationships determine how the genes will be  expressed/ in the agent. Minimal complete definition: ...creatur$Given two possible forms of a gene, .a takes into account any dominance relationship, and returns a gene representing the result.0creatur(Sums: encode choice between constructors1creatur*Meta-information (constructor names, etc.)2creatur8Constants, additional parameters and recursion of kind *3creatur-Unit: used for constructors without arguments@creatur3Products: encode multiple arguments to constructors-./-./(c) Amy de Buitlir 2011-2018 BSD-styleamy@nualeargais.ie experimentalportableSafeCsBcreaturB msg& formats and writes a new log message.ABCABC(c) Amy de Buitlir 2011-2018 BSD-styleamy@nualeargais.ie experimentalportableNonesDcreaturFrom 1http://www.haskell.org/haskellwiki/Random_shuffleEcreaturE xs n x returns a copy of xs in which the n4th element (if it exists) has been replaced with x.FcreaturF xs n x returns a copy of xs in which the n%th element has been replaced with x. Causes an exception if xs has fewer than n+1 elements. Compare with E.Gcreatur Assuming xs> is a sequence containing the elements of a square matrix, G n xs/ returns the elements of the submatrix of size nxn(, centred within the original matrix xs.Example: Suppose we have a 5x5. matrix and we want to extract the central 3x3! submatrix, as illustrated below. da b c d e f g h i j g h i k l m n o ---> l m n p q r s t q r s u v w x y8We can represent the elements of the original matrix as  ['a'..'y']*. The elements of the submatrix are -['g', 'h', 'i', 'l', 'm', 'n', 'q', 'r', 's'], or equivalently,  "ghilmnqrs". And that is what G 3 ['a'..'y'] returns.Hcreatur Assuming xs8 is a sequence containing the elements of a matrix with k columns, H (a,b) (c, d) k xs/ returns the elements of the submatrix from (a,b) in the upper left corner to (c,d)A in the lower right corner). Note: Matrix indices begin at (0,0).Example: Suppose we have a 4x6Z matrix and we want to extract the submatrix from (1,2) to (2,4), as illustrated below. Oa b c d e f g h i j k l ---> i j k m n o p q r o p q s t u v w x8We can represent the elements of the original matrix as  ['a'..'x']*. The elements of the submatrix are ['i', 'j', 'k', 'o', 'p', 'q'], or equivalently, "ijkopq". And that is what H (1,2) (2,4) 6 ['a'..'x'] returns.IcreaturI nE returns the greatest integer not greater than the square root of n.JcreaturJ n mD returns the greatest integer not greater than the log base n of m.KcreaturK n returns True if nP is a perfect square (i.e., if there exists an _integer_ m such that m*m = n)Lcreaturn L m returns True if nL is a power of m (i.e., if there exists an _integer_ k such that m^k = n)OcreaturThe O' function takes a default value and an e value. If the e is fT, it returns the default value; otherwise, it returns the value contained in the g.PcreaturTakes a list of e s and returns a list of all the g values.QcreaturvLike modify, but the function that maps the old state to the new state operates in the inner monad. For example, s <- get s' = lift $ f s put s'can be replaced with  modifyLift fRcreaturInvoke a function in the inner monad, and pass the state as a parameter. Similar to modifyLift, but the function being invoked doesn't have a return value, so the state is not modified. For example, s <- get s' = lift $ f scan be replaced with  getLift fTcreatur&Convert a list of bits to a string of 0s and 1s.UcreaturShow  non-negative h numbers in binary.DEFGHIJKLMNOPQRSTUJLIKHGFMSEDTUNOPQR(c) Amy de Buitlir 2012-2018 BSD-styleamy@nualeargais.ie experimentalportableNonevDWcreaturBCreates a counter that will store its value in the specified file.VWXYZ[VWXYZ[(c) Amy de Buitlir 2013-2018 BSD-styleamy@nualeargais.ie experimentalportableNone;=ygcreaturBCreates a counter that will store its value in the specified file. _`fdbaceg `fdbace_g (c) Amy de Buitlir 2011-2018 BSD-styleamy@nualeargais.ie experimentalportableNoneicreaturA rotating logger.jcreaturj d prefix n2 creates a logger that will write to directory d2. The log "rotates" (starts a new log file) every n4 records. Log files follow the naming convention prefix.k, where kj is the number of the last log record contained in the file. If logging has already been set up in  directoryY, then logging will continue where it left off; appending to the most recent log file.ABijABij (c) Amy de Buitlir 2011-2018 BSD-styleamy@nualeargais.ie experimentalportableNonencreaturA rotating logger.ocreaturo f- creates a logger that will write to file f.nono (c) Amy de Buitlir 2011-2018 BSD-styleamy@nualeargais.ie experimentalportableNone5 screaturqCuts two lists at the specified locations, swaps the ends, and splices them. The resulting lists will be: 6 a[0..n-1] ++ b[m..] b[0..m-1] ++ a[n..]  Here are some examples.   Expression Result s6 2 5 ("abcdef", "ABCDEF") ("abF","ABCDEcdef") s5 3 1 ("abcd", "ABCDEFG") ("abcBCDEFG","Ad") s4 4 4 ("abcdef", "ABCDEF") ("abcdEF","ABCDef") i If n <= 0 or m <= 0, the corresponding input list will be completely transferred to the other.   Expression Result s6 0 4 ("abcdef", "ABCDEF") ("EF","ABCDabcdef") s6 (-2) 4 ("abcd", "ABCDEFGH") ("EFGH","ABCDabcd") s4 5 0 ("abcdef", "ABCDEF") ("abcdeABCDEF","f") v If n or m are greater than or equal to length of the corresponding list, that list will not be transferred.   Expression Result s6 10 0 ("abcdef", "ABCDEF") ("abcdefABCDEF","") s. 0 0 ("", "ABCDEF") ("ABCDEF","") tcreaturSame as s8, except that the two locations are chosen at random.ucreaturgCuts two lists at the specified location, swaps the ends, and splices them. This is a variation of s where n == m.vcreaturSame as u3, except that the location is chosen at random.wcreatur%Mutates a random element in the list.xcreatur/Mutates a random element in one list in a pair.ycreatur5Performs an operation with the specified probability.zcreatur^Performs an operation a random number of times. The probability of repeating the operation n times is p^n.icreaturNRandomly select a boolean, but weighted to return True with probability p.jcreaturPChoose an element at random from a list and return the element and its index stuvwxyz{| uswx|{vtzy (c) Amy de Buitlir 2013-2018 BSD-styleamy@nualeargais.ie experimentalportableNone 67;<=FSTVfcreatur(A class representing anything which is represented in, and determined by, an agent's genome. This might include traits, parameters, "organs" (components of agents), or even entire agents. Instances of this class can be thought of as genes, i.e., instructions for building an agent.creaturWrites a gene to a sequence.creatur"Reads the next gene in a sequence.creaturReturn the entire genome.creatur4Return the portion of the genome that has been read.creatur5Write a Word8 value to the genome without encoding itcreatur6Read a Word8 value from the genome without decoding itcreatur2Write a raw sequence of Word8 values to the genomecreatur3Read a raw sequence of Word8 values from the genomecreaturReturn the entire genome.creatur4Return the portion of the genome that has been read.creaturRead the next pair of genes from twin sequences of genetic information, and return the resulting gene (after taking into account any dominance relationship) and the remaining (unread) portion of the two nucleotide strands.creatur(Sums: encode choice between constructorscreatur8Constants, additional parameters and recursion of kind *creatur-Unit: used for constructors without argumentscreatur3Products: encode multiple arguments to constructorscreatur*Meta-information (constructor names, etc.)}~~} (c) Amy de Buitlir 2014-2018 BSD-styleamy@nualeargais.ie experimentalportableNone 67;<=FSTcreatur(A class representing anything which is represented in, and determined by, an agent's genome. This might include traits, parameters, "organs" (components of agents), or even entire agents. Instances of this class can be thought of as genes, i.e., instructions for building an agent.creaturWrites a gene to a sequence.creatur"Reads the next gene in a sequence.creaturReturn the entire genome.creatur4Return the portion of the genome that has been read.creatur6Write a Word16 value to the genome without encoding itcreatur7Read a Word16 value from the genome without decoding itcreatur3Write a raw sequence of Word16 values to the genomecreatur4Read a raw sequence of Word16 values from the genomecreaturReturn the entire genome.creatur4Return the portion of the genome that has been read.creaturRead the next pair of genes from twin sequences of genetic information, and return the resulting gene (after taking into account any dominance relationship) and the remaining (unread) portion of the two nucleotide strands.creatur(Sums: encode choice between constructorscreatur*Meta-information (constructor names, etc.)creatur8Constants, additional parameters and recursion of kind *creatur-Unit: used for constructors without argumentscreatur3Products: encode multiple arguments to constructors(c) Amy de Buitlir 2013-2018 BSD-styleamy@nualeargais.ie experimentalportableNone 67;<=FST creatur(A class representing anything which is represented in, and determined by, an agent's genome. This might include traits, parameters, "organs" (components of agents), or even entire agents. Instances of this class can be thought of as genes, i.e., instructions for building an agent.creaturWrites a gene to a sequence.creatur"Reads the next gene in a sequence.creaturReturn the entire genome.creatur4Return the portion of the genome that has been read.creaturReturn the entire genome.creatur4Return the portion of the genome that has been read.creaturRead the next pair of genes from twin sequences of genetic information, and return the resulting gene (after taking into account any dominance relationship) and the remaining (unread) portion of the two nucleotide strands.creatur(Sums: encode choice between constructorscreatur8Constants, additional parameters and recursion of kind *creatur-Unit: used for constructors without argumentscreatur3Products: encode multiple arguments to constructorscreatur*Meta-information (constructor names, etc.)(c) Amy de Buitlir 2012-2018 BSD-styleamy@nualeargais.ie experimentalportableNone<FT<creatursA simple database where each record is stored in a separate file, and the name of the file is the record's key.creatur d0 (re)creates the FSDatabase in the directory d.kcreaturRead a record from a file.lcreaturWrite a record to a file.(c) Amy de Buitlir 2014-2018 BSD-styleamy@nualeargais.ie experimentalportableNone<FTVcreatursA simple database where each record is stored in a separate file, and the name of the file is the record's key.creatur mkFSDatabase d0 (re)creates the FSDatabase in the directory d.(c) Amy de Buitlir 2014-2018 BSD-styleamy@nualeargais.ie experimentalportableNone<FTSafegmnopqrst(c) Amy de Buitlir 2012-2018 BSD-styleamy@nualeargais.ie experimentalportableNone;<=FT creatur]An artificial life species. All species used in Cratr must be an instance of this class. creaturReturns the agent ID. creatur4Returns True if the agent is alive, false otherwise.creatur%A unique ID associated with an agent.creatur7The internal clock used by Cratr is a simple counter.      (c) Amy de Buitlir 2012-2018 BSD-styleamy@nualeargais.ie experimentalportableNoneFT2creaturyA species that reproduces, transmitting genetic information to its offspring. Minimal complete definition: all except mate.creatur2A sequence of hereditary information for an agent.creaturmRecombines the genetic information from two parents, creating genetic information for potential offspring.,Typically this involves the following steps: hRecombine the two strands of genetic information (one from each parent) to obtain two new strands.1Discard one strand, and return the remaining one.creaturLBuilds an agent based on the genome provided, if it is possible to do so.creatur (parent1, parent2) name& uses the genetic information from parent1 and parent2) to produce a child with the agent ID name. The default implementation: Calls " to create a genome for the child.Calls ' to construct a child with this genome.(c) Amy de Buitlir 2012-2018 BSD-styleamy@nualeargais.ie experimentalportableNoneFTscreaturyA species that reproduces, transmitting genetic information to its offspring. Minimal complete definition: all except mate.creatur|A sequence of hereditary information for an agent. The type signature for the agent's genome is (Strand a, Strand a).creatur From the twoC strands of the genetic information from this agent, creates a singlex strand that will contribute to the child's genome. (This is analogous to creating either a single sperm or ova.)creaturLBuilds an agent based on the genome provided, if it is possible to do so.creatur (parent1, parent2) name& uses the genetic information from parent1 and parent2) to produce a child with the agent ID name. The default implementation: Calls J to produce a single strand of genetic information from each parent.7Pairs the two strands to create a genome for the child.Calls $ construct a child with this genome.(c) Amy de Buitlir 2012-2018 BSD-styleamy@nualeargais.ie experimentalportableNone!ZcreaturA clock representing the time in a Cratr universe. It is used to schedule events and ensure that each agent gets its fair share of the CPU. This clock is entirely separate from the system clock. It advances only when  is called. This allows Cratr to run without being affected by other processes which might be using the CPU at the same time.creatur%The current time, measured in "ticks"creatur%Advance the clock to the next "tick".(c) Amy de Buitlir 2012-2018 BSD-styleamy@nualeargais.ie experimentalportableNone;=$"creaturBCreates a counter that will store its value in the specified file. !" !"(c) Amy de Buitlir 2012-2018 BSD-styleamy@nualeargais.ie experimentalportableNone&'creatur-Assign a unique ID using the supplied prefix.%&'(&'%((c) Amy de Buitlir 2012-2018 BSD-styleamy@nualeargais.ie experimentalportableNone ;<=FTVEe.creaturA program involving multiple agents. The input parameter is a list of agents. The program must return a list of agents that have been *modified*. The order of the output list is not important./creaturA program involving one agent. The input parameter is the agent. The program must return the agent (which may have been modified).0creatur%A habitat containing artificial life.Acreatur-The current "time" (counter) in this universeBcreatur8Increment the current "time" (counter) in this universe.Ccreatur2Write a message to the log file for this universe.Dcreatur'Generate a unique name for a new agent.Ecreatur-Returns the list of agents in the population.Fcreatur1Returns the list of (dead) agents in the archive.Gcreatur+Returns the current size of the population.HcreaturzFetches the agent with the specified ID from the population. Note: Changes made to this agent will not "take" until K is called.Icreatur9Fetches the agent with the specified ID from the archive.Jcreatur>Fetches the agents with the specified IDs from the population.KcreaturIf the agent is alive, adds it to the population (replacing the the previous copy of that agent, if any). If the agent is dead, places it in the archive.Mcreatur!Run a program involving one agentOcreaturRReturns the current lineup of (living) agents in the universe. Note: Check for Q and call R, if needed before invoking this function.PcreaturKReturns true if no agents have yet their turn at the CPU for this round.Qcreatur{Returns true if the lineup is empty or if all of the agents in the lineup have had their turn at the CPU for this round.RcreaturZCreates a fresh lineup containing all of the agents in the population, in random order.Screatur\Mark the current agent done. If it is still alive, it will move to the end of the lineup.*,-./0162354978:;<=>?@ABCDEFGHIJKLMNOPQRSTU*0162354978:;<=>?@-,TUABCEFGHIJKD/M.NLOPQRS(c) Amy de Buitlir 2012-2018 BSD-styleamy@nualeargais.ie experimentalportableNone<FTI`creaturZCan be used as a startupHandler, shutdownHandler, startRoundProgram, or endRoundProgram ./MN\]^_`abcd /.MNab\]^`_cdu !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~2               Zy[     1{ !"#$%'&'(&')&'*&+, - ./0123456789%creatur-5.9.25-4BXPGZODirx4PLcS9SrlawALife.Creatur.DaemonALife.Creatur.DatabaseALife.Creatur.Genetics.AnalysisALife.Creatur.Genetics.DiploidALife.Creatur.LoggerALife.Creatur.UtilALife.Creatur.PersistentALife.Creatur.Checklist)ALife.Creatur.Logger.SimpleRotatingLogger!ALife.Creatur.Logger.SimpleLogger$ALife.Creatur.Genetics.Recombination ALife.Creatur.Genetics.BRGCWord8!ALife.Creatur.Genetics.BRGCWord16ALife.Creatur.Genetics.BRGCBool!ALife.Creatur.Database.FileSystem/ALife.Creatur.Database.CachedFileSystemInternal ALife.Creatur4ALife.Creatur.Genetics.Reproduction.SimplifiedSexual*ALife.Creatur.Genetics.Reproduction.SexualALife.Creatur.ClockALife.Creatur.CounterALife.Creatur.NamerALife.Creatur.UniverseALife.Creatur.Task'ALife.Creatur.Database.CachedFileSystem Paths_creatur CreaturDaemondaemonjobJob onStartup onShutdown onExceptiontask sleepTime simpleDaemonlaunchlaunchInteractiverequestShutdownDatabaseDBRecordkeys numRecords archivedKeyslookuplookupInArchivereadAllreadAllInArchivestoredelete SizedRecordsizeRecordkey Analysableanalyse$fGAnalysableM1$fGAnalysable:+:$fGAnalysable:*:$fGAnalysableU1$fAnalysableEither$fAnalysable(,)$fAnalysableMaybe$fAnalysable[]$fAnalysableWord16$fAnalysableWord8$fAnalysableChar$fAnalysableBool$fGAnalysableK1Diploidexpress expressMaybe $fGDiploidM1 $fGDiploid:+: $fGDiploid:*: $fGDiploidU1 $fDiploid(,)$fDiploidMaybe $fDiploid[]$fDiploidDouble$fDiploidWord64$fDiploidWord32$fDiploidWord16$fDiploidWord8 $fDiploidWord $fDiploidInt $fDiploidChar $fDiploidBool $fGDiploidK1Logger writeToLog timestampshufflesafeReplaceElementreplaceElement cropSquarecropRectisqrtilogBase perfectSquare isPowerOf reverseLookupstateMap fromEither catEithers modifyLiftgetLiftrotate boolsToBitsshowBin Persistent mkPersistentgetPSputPSmodifyPSrunPS$fShowPersistent$fReadPersistent$fEqPersistentPersistentChecklist CheckliststatusmarkDone notStarteddonesetItemsmkPersistentChecklist$fChecklistPersistentSimpleRotatingLoggermkSimpleRotatingLogger$fLoggerSimpleRotatingLogger$fShowSimpleRotatingLogger$fEqSimpleRotatingLogger SimpleLoggermkSimpleLogger$fLoggerSimpleLogger$fShowSimpleLogger$fEqSimpleLogger cutAndSplicerandomCutAndSplice crossoverrandomCrossover mutateListmutatePairedListswithProbabilityrepeatWithProbabilityrandomOneOfPairrandomOneOfList DiploidReaderDiploidSequenceGeneticputgetgetWithDefaultReaderWriterSequencewrite runWriterread runReadercopyconsumed putRawWord8 getRawWord8 putRawWord8s getRawWord8s putAndReport getAndReportreadAndExpressrunDiploidReadercopy2 consumed2 getAndExpressgetAndExpressWithDefault $fGGeneticM1 $fGGenetic:*: $fGGeneticU1$fGeneticEither $fGenetic(,)$fGeneticMaybe $fGenetic[]$fGeneticDouble$fGeneticInteger $fGeneticInt$fGeneticWord64$fGeneticWord32$fGeneticWord16$fGeneticWord8 $fGeneticChar $fGeneticBool $fGGeneticK1 $fGGenetic:+: getWithName putRawWord16 getRawWord16 putRawWord16s getRawWord16s FSDatabase mkFSDatabase$fDatabaseFSDatabase$fShowFSDatabase$fEqFSDatabaseCachedFSDatabasedatabasecache maxCacheSizewithFSDB fromCache addToCachedeleteByKeyFromCachedeleteFromCache trimCachetrimlistSizemkCachedFSDatabase$fDatabaseCachedFSDatabase$fShowCachedFSDatabase$fEqCachedFSDatabaseAgentagentIdisAliveAgentIdTimeprogramVersion ReproductiveStrand recombinebuild makeOffspring produceGameteClock currentTimeincTimePersistentCounterCountercurrent incrementmkPersistentCounter$fClockPersistent$fCounterPersistent SimpleNamerNamergenName mkSimpleNamer$fNamerSimpleNamer$fShowSimpleNamer$fEqSimpleNamerCachedUniverseSimpleUniverse AgentsProgram AgentProgramUniverseAgentDBclocksetClocklogger setLoggeragentDB setAgentDB agentNamersetNamer checklist setChecklistagentIdsarchivedAgentIdspopSizegetAgentgetAgentFromArchive getAgentsisNew withAgent withAgentslineup startOfRound endOfRound refreshLineupmkSimpleUniversemkCachedUniverse$fUniverseSimpleUniverse$fUniverseCachedUniverse$fShowSimpleUniverse$fEqSimpleUniverse$fShowCachedUniverse$fEqCachedUniverse simpleJobstartupHandlershutdownHandlerexceptionHandler doNothingrunNoninteractingAgentsrunInteractingAgents checkPopSizebase Data.EitherEitherLeftRightGHC.RealIntegralweightedRandomBooleanrandomListSelection readRecord3 writeRecord3version getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName