-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(type-infer): Add new tests for type application insertion
- Loading branch information
1 parent
93f8f8a
commit a341c65
Showing
4 changed files
with
66 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Arbitrary.Type where | ||
|
||
import Elara.TypeInfer.Monotype qualified as Scalar | ||
import Elara.TypeInfer.Type | ||
import Hedgehog | ||
import Hedgehog.Gen qualified as Gen | ||
|
||
arbitraryType :: Gen (Type ()) | ||
arbitraryType = | ||
Gen.recursive | ||
Gen.choice | ||
[ Scalar () | ||
<$> Gen.choice | ||
[ pure Scalar.Unit | ||
, pure Scalar.Bool | ||
, pure Scalar.Integer | ||
, pure Scalar.Real | ||
, pure Scalar.Char | ||
, pure Scalar.Text | ||
] | ||
] | ||
[Gen.subterm2 arbitraryType arbitraryType (Function ())] |
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