amnh / PCG

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

Use custom ExitCode values to indicate different failure types #115

Closed recursion-ninja closed 5 years ago

recursion-ninja commented 5 years ago

We can use different ExitCode values to indicate the different types of failure that can occur during our computation.

There are very refined failure types in the following modules:

Each one of these error conditions could receive a special ExitCode value to be checked after the program completes. The benifit of this is that we can check the ExitCode value in our integration test suite to ensure that certain expected failure occur, and not just that "any" failure has occurred.

This change will require a little bit of tinkering with the EvalUnit type. The Error constructor should contain an Int8 for the ExitCode value. The fail function should supply a default ExitCode value. We will export a new function failWith :: Int8 -> String to allow for failing with a specific exit code in the EvaluationT monadic context.

recursion-ninja commented 5 years ago

Document what each custom exit code means in the PCG help menu.

recursion-ninja commented 5 years ago

Unfortunately, this was more involved than anticipated and there has been some scope-creep when attempting to make the changes consistent and well-typed.

pcg-error-phase:

pcg-validationT:

pcg-file-source:

pcg:

CHANGELOG.md:

recursion-ninja commented 5 years ago
recursion-ninja commented 5 years ago
recursion-ninja commented 5 years ago
recursion-ninja commented 5 years ago

I decided not to add an integration test of opening 1024 small files at once. The files all open successfully, but there appears to be efficiency issues associated with that many character blocks.

Profiling and remedying this efficiency issue is beyond the scope of this issue.

recursion-ninja commented 5 years ago

This has been completed, see 4db324b.