Closed recursion-ninja closed 5 years ago
Add the MonadReader
type-class instance to Evaluation
andMonadReaderT
to EvaluationT
to store "global variable".
I'm not sure whether Evaluation has a legal Reader instance?
I have now factored this out and added a test suite for Logger and Writer instances for Evaluation and EvaluationT here: https://github.com/amnh/PCG/commit/5771d5d66c79f37e65c54e703eaa88c717bd0d66
For the Reader instance I changed SearchState as follows:
type GlobalSettings = ()
type SearchState = EvaluationT (ReaderT GlobalSettings IO) GraphState
I then added a MonadReader instance for EvaluationT and made the necessary changes to main etc. There is now a function defined in PCG.Computation.Internal
as follows:
getGlobalSettings :: IO GlobalSettings
For now though it doesn't do anything.
The
Control.Evaluation
module is self contained (includingControl.Monad.Logger
). We should move these two libraries into a sub library along with their test suites.Add test suites for the
MonadLogger
type-class that "failure nullification" and "associativity" hold.Add the
MonadWriter
type-class instance toEvaluation
andMonadWriterT
toEvaluationT
.