MathiasBartl / Concurrent_Datastructures

Concurrent Datastructures for Haskell - Gsoc 2014
GNU General Public License v2.0
1 stars 0 forks source link

Single Threat Assertions #30

Open MathiasBartl opened 9 years ago

MathiasBartl commented 9 years ago

Regarding the problems with resize, I thought about making some assertions that hold for single thread use, like f.e. adding a value increses the size by one (dumb example). Since otherwise there are very few assertions that can be made in multi threted code. How do I best realize assertions that depend on some flag?

rrnewton commented 9 years ago

Aren't normal Haskell asserts turned off automatically when compiling with optimization?

MathiasBartl commented 9 years ago

I just want to kind of assertions, one that are checked during every test, and one that are onky checked during single threated tests.

rrnewton commented 9 years ago

Ah well then it sounds like you just need a runtime boolean flag that controls whether the asserts are active -- i.e. passed in as an argument to the function that builds the test suite, or via a Reader monad.

MathiasBartl commented 9 years ago

Yes technically its simple, but should be an very usefull idea.