mroman42 / mikrokosmos

(λ) Educational lambda calculus interpreter
https://mroman42.github.io/mikrokosmos
GNU General Public License v3.0
70 stars 7 forks source link

Add call by value and call by name evaluation strategies #55

Closed rjraya closed 4 years ago

rjraya commented 4 years ago

I added some code that allows the user to reduce lambda terms under call by value/call by name strategies. It would be good to have some tests for these but I'm not sure what tests to use.

mroman42 commented 4 years ago

Looks good to me, thank you! This would also solve issue #52.

If you want to think of tests that would be great, but I think not breaking the existing ones is more than enough for this to be merged. It should not conflict with anything else. Did you already check that the tests are still working with stack test? After that I am merging.

rjraya commented 4 years ago

This is the output I get from stack test:

mikrokosmos> test (suite: test)

Tests Parser tests INR parser test: OK INL parser test: OK Spaces between lambdas test: OK Multiple-character variable name test: OK Type inference tests Identity type inference: OK Double negation of LEM: OK SKI abstraction tests Identity SKI abstraction: OK Numeral 2 SKI abstraction: OK Lambda expression properties (quickcheck) Expression -> named -> expression: OK +++ OK, passed 100 tests. Open expressions are not allowed: OK +++ OK, passed 100 tests. Parser properties (quickcheck) Comments are ignored: OK +++ OK, passed 100 tests. Golden tests (tasty-golden) Main golden test: OK

All 12 tests passed (0.03s)

mikrokosmos> Test suite test passed

mroman42 commented 4 years ago

Done, maybe after this I should upload the new version to Hackage.