amnh / PCG

𝙋𝙝𝙮𝙡𝙤𝙜𝙚𝙣𝙚𝙩𝙞𝙘 𝘾𝙤𝙢𝙥𝙤𝙣𝙚𝙣𝙩 𝙂𝙧𝙖𝙥𝙝 ⸺ Haskell program and libraries for general phylogenetic graph search
28 stars 1 forks source link

The evaluation model doesn't perform work when it should #119

Closed recursion-ninja closed 5 years ago

recursion-ninja commented 5 years ago

The evaluation model report a NoOp value from the following script:

load("graph.bin")
report(data,"cost.data")

Thus script should preform I/O work attempting to deserialize the "graph.bin" file contents, and on a success, report the graph state that was deserialized.

I think one prudent solution might be to remove the NoOp value from the EvalUnit along with the Monoid and MonadPlus instances from the Evaluation monad. I believe we will only want to operate over non-empty structures (such as NonEmpty Command) with something like traverse1, so the NoOp value is probably better left as unrepresented.

Once resolved, we should add integration tests to ensure that the evaluation model works on a variety of use cases for retrieving input and writing output, not just READ/REPORT commands.

recursion-ninja commented 5 years ago

The Control.Evaluation module has been reworked & refactored to omit the NoOp value. The associated test-suite has been vastly expanded. The high level computation has also been updated to reflect this lack of an identity state. In the defective case described above, the expected work is now correctly performed. See this commit: 356fd8d

Additionally, new tests were added to the integration test-suite to ensure that the SAVE/LOAD/REPORT case described above does not regress. See this commit: 7eb9577