-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start adding type-level simplification tests
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module Main where | ||
|
||
import Test.TypeSpec hiding ( And ) | ||
import Rerefined.Simplify | ||
import Rerefined.Predicates | ||
import Rerefined.Predicate | ||
import TypeLevelShow.Utils ( type (++) ) | ||
|
||
main :: IO () | ||
main = print spec | ||
|
||
spec :: Expect | ||
(And Fail Succeed `SimplifiesTo` Fail | ||
-/- And Succeed Fail `SimplifiesTo` Fail | ||
-/- And Succeed Succeed `SimplifiesTo` Succeed | ||
-/- And Fail Fail `SimplifiesTo` Fail | ||
|
||
-/- Or Succeed Fail `SimplifiesTo` Succeed | ||
-/- Or Fail Succeed `SimplifiesTo` Succeed | ||
-/- Or Succeed Succeed `SimplifiesTo` Succeed | ||
-/- Or Fail Fail `SimplifiesTo` Fail | ||
-/- And (CompareLength RelOpLT 3) (CompareLength RelOpGT 3) | ||
`SimplifiesTo` Fail | ||
) | ||
spec = Valid | ||
|
||
-- | TODO I'd like to write my own message here, but type-spec is complicated. | ||
type SimplifiesTo p p' = It | ||
(PredicateName 0 p ++ " simplifies to " ++ PredicateName 0 p') | ||
(TrySimplify p `Is` Just p') |