-
Notifications
You must be signed in to change notification settings - Fork 89
Typing for parameterised libraries #1726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
387 commits
Select commit
Hold shift + click to select a range
a3b7a31
Update bootstrap compiler
lukemaurer fa251ce
Fix upstream build
lukemaurer 6f86fb9
Disable test of error message
lukemaurer 88b6185
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer 52ea8fd
Revert "Disable test of error message"
lukemaurer a9eea0b
Fix upstream build
lukemaurer 4f01e24
Merge branch 'layered-persistent_env' into as-argument-for
lukemaurer 3c5b7b5
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer d619a45
Fix conflicts
lukemaurer 156fd09
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer 8b42e26
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer 553ff3e
Merge branch 'instance-syntax' into instance-typing
lukemaurer b4ec625
Normalise test specification
lukemaurer 591a4ec
Generate test specifications
lukemaurer 268ebbd
Test native compilation
lukemaurer c15dcfb
Ability to add extra variables to actions in `gen_test`
lukemaurer 0a8ee56
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer a17d34c
Update test generation and add native tests
lukemaurer 70b77ea
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer dc1a3eb
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer b62e6c2
Merge branch 'instance-syntax' into instance-typing
lukemaurer d051da2
Update test generation and add native tests for instance typing
lukemaurer 294ad42
Merge remote-tracking branch 'upstream/main' into as-parameter
lukemaurer 5518617
Merge remote-tracking branch 'upstream/main' into as-parameter
lukemaurer 77e4338
Merge branch 'as-parameter' into cu-name-is-cmi
lukemaurer 23adeca
Merge branch 'as-parameter' into cu-name-is-cmi
lukemaurer 9234fcd
Bootstrap
lukemaurer 4b2f192
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer 025558c
Remove warning boilerplate from new files
lukemaurer 4c0c8b6
Update `ocaml/.depend`
lukemaurer f494b9f
Merge branch 'layered-persistent_env' into as-argument-for
lukemaurer 3b8a7f5
Fix a bit of silly back-and-forth
lukemaurer daaf996
Update tests following rebase
lukemaurer 987a2bd
Partially fix Closure
lukemaurer 2c8ca86
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer 4dd61bb
Merge remote-tracking branch 'upstream/main' into as-parameter
lukemaurer c67a202
Merge remote-tracking branch 'upstream/main' into as-parameter
lukemaurer 4322629
Use unnamed field instead of double module block
lukemaurer 6d22bc4
Store argument block itself rather than coercion function
lukemaurer 398cc90
Bring in squashed merge of 'as-parameter' branch
lukemaurer 9db2c13
Merge branch 'unsquash/as-parameter' into cu-name-is-cmi
lukemaurer bf51bd8
Merge remote-tracking branch 'upstream/main' into cu-name-is-cmi
lukemaurer 28654cc
Merge remote-tracking branch 'upstream/main' into unsquash/as-parameter
lukemaurer f1e32a9
Merge branch 'unsquash/as-parameter' into cu-name-is-cmi
lukemaurer 7d7a241
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer 65e2a92
Fix build of upstream objinfo
lukemaurer dc7eeaf
Bootstrap
lukemaurer 489b046
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer fa9a22e
Fix upstream build
lukemaurer ff674e2
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer 4cfa38c
Update .depend
lukemaurer 35f2a8b
Merge branch 'instance-syntax' into instance-typing
lukemaurer 92f6810
Fix upstream build
lukemaurer a4b0c82
Copy new functionality from flambda_backend_objinfo to objinfo
lukemaurer 3cb1126
Code review
lukemaurer e05a7f5
Code review
lukemaurer b3be73d
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer b07af9b
Merge branch 'layered-persistent_env' into as-argument-for
lukemaurer a277c51
Bootstrap
lukemaurer 73f2689
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer e94a213
Fix compilation following merge
lukemaurer 5de168d
Bootstrap
lukemaurer 0372eae
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer e8abb3a
Remove code gen changes from `-as-argument-for` branch
lukemaurer c816563
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer 1cee4f4
Remove code gen changes from 'parameter-parameter' branch
lukemaurer 68e347c
Bootstrap
lukemaurer 814a8a7
Remove more code gen code from 'parameter-parameter' branch
lukemaurer c36393a
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer 95e7772
Generate stub variables for runtime parameters
lukemaurer abf0b5d
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer 068617c
Merge tag 'global-name-is-module-id-with-code-gen' into instance-syntax
lukemaurer c03a925
Merge tag 'instance-syntax-with-code-gen' into instance-typing
lukemaurer 6e3c291
Regenerate .depend
lukemaurer 7c8d0b5
Fix compilation following merge
lukemaurer da71d09
Bootstrap following merge
lukemaurer ab1ea2c
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer f3c613c
Merge branch 'instance-syntax' into instance-typing
lukemaurer 2a33784
Fix formatting
lukemaurer f68d199
Define `Global.Name.t` in `jane_syntax.mli` to remove dependency
lukemaurer 59dc502
Merge branch 'instance-syntax' into instance-typing
lukemaurer f0e5033
Fix compilation following merge
lukemaurer a6a06c5
Fix upstream build: don't let `Global` dep on `Jane_syntax` either
lukemaurer c3b1667
Merge branch 'instance-syntax' into instance-typing
lukemaurer 635fe93
Promote test changes
lukemaurer 7d6f798
Rename `secondary_interface` to `argument_interface`
lukemaurer 87ab117
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer a903a9a
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer 696b4c9
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer f35e332
Merge branch 'instance-syntax' into instance-typing
lukemaurer 7dab499
Remove stray `cu_runtime_params` reference
lukemaurer c086a8a
Remove .cmx-related code gen code from 'parameter-parameter' branch
lukemaurer ee1958b
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer 766cfa9
Fix compilation following merge
lukemaurer 48c3576
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer 988e8b2
Merge branch 'instance-syntax' into instance-typing
lukemaurer 3b5b143
Remove unused function
lukemaurer 50d0266
Bootstrap
lukemaurer ccd7064
Overhaul `Import_info` implementation and new API
lukemaurer c6f988b
Code review
lukemaurer 91c2329
Bootstrap
lukemaurer 8a2b5c2
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer a3641bb
Compilation fixes following merge
lukemaurer 7e760a1
Copy changes from `asmlink.ml` to `asmlink.ml`
lukemaurer 014a2d3
Rename a few things for consistency and update comments
lukemaurer 66fb8b8
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer 447c2dd
Merge remote-tracking branch 'upstream/main' into cu-name-is-cmi
lukemaurer f1be371
Merge branch 'layered-persistent_env' into as-argument-for
lukemaurer 91b0725
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer d701be1
Code review
lukemaurer d4cacae
Re-check visibility on _either_ cache hit
lukemaurer efd3020
Merge remote-tracking branch 'upstream/main' into cu-name-is-cmi
lukemaurer 2adb8bd
Rename a few things for code review
lukemaurer 381a67c
Merge branch 'cu-name-is-cmi' into layered-persistent_env
lukemaurer 4ad0aa3
Merge branch 'upstream/main' into layered-persistent_env, up to squas…
lukemaurer 5af30a5
Bring in squashed merge of 'cu-name-is-cmi' branch
lukemaurer f255c62
Merge remote-tracking branch 'upstream/main' into layered-persistent_env
lukemaurer 6c16e9d
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer 9fcab53
Merge branch 'layered-persistent_env' into as-argument-for
lukemaurer 288ed6c
Remove test spec generator
lukemaurer 5f5a85b
Merge remote-tracking branch 'upstream/main' into instance-library
lukemaurer 1159e12
Remove now-unused functions from `Misc`
lukemaurer 531c90c
Have `Global.subst` return whether the input changed
lukemaurer 1e681ac
Bring in squashed merge of 'layered-persistent_env' branch
lukemaurer 9dde77e
Rename `global.ml` to `global_module.ml` and move into `typing/`
lukemaurer 6272975
Improve error messages
lukemaurer 70a9aa2
Code review
lukemaurer 2eb82e8
Translate test file ahead of rebase
lukemaurer 59ea4f9
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer 81e099e
Fix compilation following merge
lukemaurer ec20f9c
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer e6904d6
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer 6733ace
Partially merge remote-tracking branch 'upstream/main' into as-argume…
lukemaurer 84c9c49
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer 7398e80
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer b87ccc0
Merge branch 'instance-library' into global-name-is-module-id
lukemaurer 9595527
Restore `Misc.merge_iter` and `Misc.merge_map`
lukemaurer a87959b
Merge remote-tracking branch 'upstream/main' into as-argument-for
lukemaurer 453d7a6
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer 54637cf
Remove stale dynlink changes left over from 'instance-library' branch
lukemaurer 4061e54
Add unsquashed 'instance-library' branch as parent
lukemaurer c6c696e
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer 67e7bd9
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer dce211c
Fix compilation following merge
lukemaurer 64802b5
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer 156aa4d
More awful `dynlink_compilerlibs` fiddling
lukemaurer 7b4bb09
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer 4a6781e
Merge branch 'instance-syntax' into instance-typing
lukemaurer 590ea5e
Adapt to new `Global_module.subst` API following merge
lukemaurer 5a8b458
Even more `dynlink` fiddling for my sins
lukemaurer a9eb21f
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer d0594b1
Merge branch 'instance-syntax' into instance-typing
lukemaurer 33a0476
Put back inadvertently-removed argument label in `Typemod`
lukemaurer 6e596bf
Don't register the argument type as a parameter import
lukemaurer 051fb88
Merge branch 'as-argument-for' into parameter-parameter
lukemaurer 91f658c
Remove concept of unexported parameters
lukemaurer 0ebda3d
Make `param_imports` a `Param_set.t`
lukemaurer e554cb4
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer 3feced2
Small bit of cleanup
lukemaurer cdc3017
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer 4fe7cf7
Remove test generation code (again)
lukemaurer dddbeaf
Add test for error on `-parameter A` when `A` is not a parameter
lukemaurer 8679b8c
Merge branch 'instance-syntax' into instance-typing
lukemaurer d9454a7
Adapt to changes in error checking
lukemaurer 4e55d0d
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer 420e422
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer cb9b7c8
Merge branch 'instance-syntax' into instance-typing
lukemaurer 5f81383
Remove check on parameters missing from instance names
lukemaurer de086d2
Merge from 'upstream/main' up to squashed 'as-argument-for' branch
lukemaurer 65376e1
Merge squashed 'as-argument-for' branch from 'upstream/main'
lukemaurer eb4f173
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer e38400f
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer 89416ab
Merge branch 'instance-syntax' into instance-typing
lukemaurer d04b0d6
Check for malformed instance names with nice error message
lukemaurer d13b95a
Test for check of repeated arg name
lukemaurer 986c82a
Merge branch 'instance-syntax' into instance-typing
lukemaurer 32ea6ef
Add test for positive case of subset rule
lukemaurer 8466bfa
Bind parameterized modules locally
lukemaurer 042b14d
Fix compilation
lukemaurer 2f3ad28
Update tests to expect local binding of parameterized modules
lukemaurer 79678ae
Update test output to account for missing flambda2 export information
lukemaurer 44400e8
Skip output check for objinfo on .cmx
lukemaurer 649b8e7
Always check for `-as-parameter` on implementation
lukemaurer 1b350b9
Disallow combining `-as-parameter` and `-parameter`
lukemaurer 08a831a
Code review: Improve error message for subset rule
lukemaurer e1c7627
Code review
lukemaurer 298f477
More code review
lukemaurer 949b7be
Code review: Use, explain "runtime parameters" terminology
lukemaurer de20fe3
Add a bit more explanation about runtime parameters
lukemaurer 81c50a7
Properly stub out shapes of parameters and parameterised modules
lukemaurer 114ff61
Merge branch 'parameter-parameter' into global-name-is-module-id
lukemaurer 8a860d6
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer e359add
Merge from 'upstream/main' up to squashed 'parameter-parameter' into …
lukemaurer 5ae92d0
Merge squashed 'parameter-parameter' into global-name-is-module-id
lukemaurer 196d358
Merge branch 'instance-syntax' into instance-typing
lukemaurer 37bd46d
Promote test following merge
lukemaurer 6af59c1
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer def8739
Merge remote-tracking branch 'upstream/main' into global-name-is-modu…
lukemaurer 5173c87
Merge remote-tracking branch 'upstream/main' into global-name-is-modu…
lukemaurer ca4c418
Revert changes to `ocaml/.depend` relative to 'upstream/main'
lukemaurer e6e922c
Deal with stale upstream references to `Global`
lukemaurer 0f76c03
Punt changes to `Shape`
lukemaurer 227e212
Don't put line breaks in `name`s of idents
lukemaurer cf2a4a4
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer e2b2da3
Merge remote-tracking branch 'upstream/main' into global-name-is-modu…
lukemaurer c8b4949
Merge branch 'instance-syntax' into instance-typing
lukemaurer e7cd6f8
Merge remote-tracking branch 'upstream/main' into global-name-is-modu…
lukemaurer a843f8f
Introduce record type for instance arguments
lukemaurer 084e460
Code review
lukemaurer 2cb6c92
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer 4753683
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer ea3d62e
Merge tag '5.1.1minus-24' into global-name-is-module-id
lukemaurer 1625c02
Merge remote-tracking branch 'upstream/main' into global-name-is-modu…
lukemaurer 86eac6d
Remove accidental copy of `Makefile.compilerlibs`
lukemaurer e143e8b
Reluctantly fix failure of egregious test
lukemaurer 70ea5f6
Code review
lukemaurer 3d0b5d1
One more change I left out of code review
lukemaurer 3423dac
Merge branch 'instance-syntax' into instance-typing
lukemaurer ca2da75
Merge branch 'global-name-is-module-id' into instance-syntax
lukemaurer 4303bb2
Fix compilation following merge
lukemaurer de4a3f4
Merge 'upstream/main' up to squashed 'global-name-is-module-id' into …
lukemaurer 1946573
Pull squash of 'global-name-is-module-id' into instance-syntax
lukemaurer 972e01c
Merge branch 'instance-syntax' into instance-typing
lukemaurer dd19fcd
Reintroduce whitespace errors that ocamlformat wants
lukemaurer 60fa615
Update expect tests following merge
lukemaurer 41cc13a
Code review
lukemaurer b2b3dbc
Clarify stub code
lukemaurer 97266cd
Merge branch 'instance-syntax' into instance-typing
lukemaurer 4d5f29c
Merge 'upstream/main' up to squashed `instance-syntax` into instance-…
lukemaurer b84ef22
Pull squash of 'instance-syntax' into instance-typing
lukemaurer 3795b6d
Put down the zombie `Makefile.compilerlibs` again
lukemaurer 33b3cf4
Remove anti-instance check that got merged in
lukemaurer e55943a
Promote expect tests following merge
lukemaurer 4f8e2ce
Add locations to errors raised by `Persistent_env`
lukemaurer 89bce1e
Improve error messages
lukemaurer edbcb55
Add tests for multi-argument case
lukemaurer 22b6b19
Enable test now that PR #2737 is merged
lukemaurer 8cd5bda
Return mode information from `Env.lookup_module_instance_path`
lukemaurer ef719c8
Add test of mode checks on instance accesses
lukemaurer 2efb7dd
Code review
lukemaurer 924b5b6
Merge remote-tracking branch 'upstream/main' into instance-typing
lukemaurer 809e0cd
Promote test following rebase
lukemaurer c101947
Normalise ocamlobjinfo output to fix test in classic mode
lukemaurer a20b255
Fix test output in classic mode (actually)
lukemaurer e8b6611
Code review
lukemaurer 72d4e0e
Improvements to error messages
lukemaurer 511d76d
Merge remote-tracking branch 'upstream/main' into instance-typing
lukemaurer a459ff4
minor adjustment
riaqn bd1f2d3
Improve comments
lukemaurer 39d68c0
Improve error messages
lukemaurer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -199,6 +199,7 @@ | |
mode | ||
jkind_types | ||
jkind_intf | ||
signature_with_global_bindings | ||
typedtree | ||
printtyped | ||
ctype | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
File "main.ml", line 1: | ||
File "main.ml", line 28, characters 11-30: | ||
28 | module _ = Use_member_directly | ||
^^^^^^^^^^^^^^^^^^^ | ||
Error: The file subdir/use_member_directly.cmi | ||
is imported both as "Pack.Member" and as "Member". |
This file contains hidden or 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 hidden or 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
2 changes: 2 additions & 0 deletions
2
testsuite/tests/templates/basic/bad_instance_arg_name_not_found.ml
This file contains hidden or 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,2 @@ | ||
module Monoid_utils_of_banana = | ||
Monoid_utils(Banana)(List_monoid) [@jane.non_erasable.instances] |
5 changes: 5 additions & 0 deletions
5
testsuite/tests/templates/basic/bad_instance_arg_name_not_found.reference
This file contains hidden or 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,5 @@ | ||
File "bad_instance_arg_name_not_found.ml", line 2, characters 2-35: | ||
2 | Monoid_utils(Banana)(List_monoid) [@jane.non_erasable.instances] | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Error: The module "Monoid_utils" has no parameter "Banana". | ||
Hint: Parameters for "Monoid_utils": "Monoid" |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/templates/basic/bad_instance_arg_value_not_arg.ml
This file contains hidden or 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,2 @@ | ||
module Monoid_utils_of_int = | ||
Monoid_utils(Monoid)(Monoid_utils(Monoid)(List_monoid)) [@jane.non_erasable.instances] |
6 changes: 6 additions & 0 deletions
6
testsuite/tests/templates/basic/bad_instance_arg_value_not_arg.reference
This file contains hidden or 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,6 @@ | ||
File "bad_instance_arg_value_not_arg.ml", line 2, characters 2-57: | ||
2 | Monoid_utils(Monoid)(Monoid_utils(Monoid)(List_monoid)) [@jane.non_erasable.instances] | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Error: The module "Monoid_utils[Monoid:List_monoid]" | ||
cannot be used as an argument for parameter "Monoid". | ||
Hint: Compile "monoid_utils.cmi" with "-as-argument-for Monoid". |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/templates/basic/bad_instance_arg_value_not_found.ml
This file contains hidden or 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,2 @@ | ||
module Monoid_utils_of_int = | ||
Monoid_utils(Monoid)(Banana) [@jane.non_erasable.instances] |
4 changes: 4 additions & 0 deletions
4
testsuite/tests/templates/basic/bad_instance_arg_value_not_found.reference
This file contains hidden or 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,4 @@ | ||
File "bad_instance_arg_value_not_found.ml", line 2, characters 2-30: | ||
2 | Monoid_utils(Monoid)(Banana) [@jane.non_erasable.instances] | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Error: Unbound module "Banana" in instance "Monoid_utils[Monoid:Banana]" |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/templates/basic/bad_instance_arg_value_wrong_type.ml
This file contains hidden or 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,2 @@ | ||
module Category_utils_of_list_monoid = | ||
Category_utils(Category)(List_monoid) [@jane.non_erasable.instances] |
7 changes: 7 additions & 0 deletions
7
testsuite/tests/templates/basic/bad_instance_arg_value_wrong_type.reference
This file contains hidden or 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,7 @@ | ||
File "bad_instance_arg_value_wrong_type.ml", line 2, characters 2-39: | ||
2 | Category_utils(Category)(List_monoid) [@jane.non_erasable.instances] | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Error: The module "List_monoid" | ||
is used as an argument for the parameter "Category" but "List_monoid" | ||
is an argument for "Monoid". | ||
Hint: "list_monoid.cmi" was compiled with "-as-argument-for Category". |
This file contains hidden or 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,5 @@ | ||
let (f @ portable) () = | ||
let module Monoid_utils_of_list_monoid = | ||
Monoid_utils(Monoid)(List_monoid) [@jane.non_erasable.instances] | ||
in | ||
() |
4 changes: 4 additions & 0 deletions
4
testsuite/tests/templates/basic/bad_instance_wrong_mode.reference
This file contains hidden or 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,4 @@ | ||
File "bad_instance_wrong_mode.ml", line 3, characters 4-37: | ||
3 | Monoid_utils(Monoid)(List_monoid) [@jane.non_erasable.instances] | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Error: Modules are nonportable, so cannot be used inside a function that is portable. |
9 changes: 6 additions & 3 deletions
9
testsuite/tests/templates/basic/bad_param_not_param.reference
This file contains hidden or 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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
File "bad_param_not_param.mli", line 1: | ||
Error: The module "Widget" is specified as a parameter, but "widget.cmi" | ||
was not compiled with -as-parameter. | ||
File "bad_param_not_param.mli", line 19, characters 17-25: | ||
19 | val frobnicate : Widget.t -> Widget.t | ||
^^^^^^^^ | ||
Error: The module "Widget" | ||
is a parameter but is not declared as such for the current unit. | ||
Hint: Compile the current unit with "-parameter Widget". |
This file contains hidden or 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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
File "bad_ref_direct.ml", line 1: | ||
Error: The file "monoid.cmi" contains the interface of a parameter. | ||
"Monoid" is not declared as a parameter for the current unit (-parameter "Monoid"). | ||
File "bad_ref_direct.ml", line 3, characters 12-21: | ||
3 | let empty = Monoid.id | ||
^^^^^^^^^ | ||
Error: The file "monoid.cmi" contains the interface of a parameter. "Monoid" | ||
is not declared as a parameter for the current unit. | ||
Hint: Compile the current unit with "-parameter Monoid". |
This file contains hidden or 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,7 @@ | ||
(* [Monoid] is not a parameter of this, but it _is_ imported because it's used | ||
as a parameter *) | ||
|
||
module Monoid_utils_of_semigroup = | ||
Monoid_utils(Monoid)(Monoid_of_semigroup) [@jane.non_erasable.instances] | ||
|
||
let empty = Monoid.empty |
6 changes: 6 additions & 0 deletions
6
testsuite/tests/templates/basic/bad_ref_direct_imported.reference
This file contains hidden or 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,6 @@ | ||
File "bad_ref_direct_imported.ml", line 7, characters 12-24: | ||
7 | let empty = Monoid.empty | ||
^^^^^^^^^^^^ | ||
Error: The file "monoid.cmi" contains the interface of a parameter. "Monoid" | ||
is not declared as a parameter for the current unit. | ||
Hint: Compile the current unit with "-parameter Monoid". |
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
File "bad_ref_indirect.ml", line 1: | ||
File "bad_ref_indirect.ml", line 2, characters 13-32: | ||
2 | let concat = Monoid_utils.concat | ||
^^^^^^^^^^^^^^^^^^^ | ||
Error: The module "Monoid_utils" is not accessible because it takes "Monoid" | ||
as a parameter and the current unit does not. | ||
Hint: Pass `-parameter "Monoid"` to add "Monoid" as a parameter | ||
Hint: Pass "-parameter Monoid" to add "Monoid" as a parameter | ||
of the current unit. |
This file contains hidden or 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 @@ | ||
include Category_intf.S |
This file contains hidden or 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 @@ | ||
include Category_intf.S |
This file contains hidden or 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 @@ | ||
include Category |
This file contains hidden or 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 @@ | ||
include Category_intf.S with type ('a, 'b) t = ('a, 'b) Category.t |
This file contains hidden or 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,6 @@ | ||
module type S = sig | ||
type ('a, 'b) t | ||
|
||
val id : ('a, 'a) t | ||
val compose : first:('a, 'b) t -> second:('b, 'c) t -> ('a, 'c) t | ||
end |
This file contains hidden or 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,6 @@ | ||
type ('a, 'b) t = Monoid.t | ||
|
||
let id = Monoid.empty | ||
let compose ~first ~second = Monoid.append first second | ||
|
||
let as_unit t = t |
This file contains hidden or 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,8 @@ | ||
type ('a, 'b) t = Monoid.t | ||
|
||
val id : ('a, 'a) t | ||
val compose : first:('a, 'b) t -> second:('b, 'c) t -> ('a, 'c) t | ||
|
||
(* Demonstrate that we can have extra functions beyond what's required by the | ||
.mli for the parameter type *) | ||
val as_unit : (_, _) t -> (unit, unit) t |
This file contains hidden or 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,5 @@ | ||
let rec concat : type a b. (a, b) Chain.t -> (a, b) Category.t = | ||
fun chain -> | ||
match chain with | ||
| [] -> Category.id | ||
| a_to_b :: b_to_c -> Category.compose ~first:a_to_b ~second:(concat b_to_c) |
This file contains hidden or 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 @@ | ||
val concat : ('a, 'b) Chain.t -> ('a, 'b) Category.t |
This file contains hidden or 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,3 @@ | ||
type (_, _) t = | ||
| [] : ('a, 'a) t | ||
| (::) : ('a, 'b) Category.t * ('b, 'c) t -> ('a, 'c) t |
This file contains hidden or 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,3 @@ | ||
type (_, _) t = | ||
| [] : ('a, 'a) t | ||
| (::) : ('a, 'b) Category.t * ('b, 'c) t -> ('a, 'c) t |
This file contains hidden or 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,7 @@ | ||
module Chain_of_semigroup = | ||
Chain(Category)(Category_of_monoid(Monoid)(Monoid_of_semigroup)) | ||
[@jane.non_erasable.instances] | ||
|
||
module Chain_of_lists = | ||
Chain(Category)(Category_of_monoid(Monoid)(List_monoid)) | ||
[@jane.non_erasable.instances] |
This file contains hidden or 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,15 @@ | ||
module Category_of_semigroup_and_lists = | ||
Product_category | ||
(Category)(Category_of_monoid(Monoid)(Monoid_of_semigroup)) | ||
(Category_b)(Category_b_of_category | ||
(Category)(Category_of_monoid(Monoid)(List_monoid))) | ||
[@jane.non_erasable.instances] | ||
|
||
module Chain_of_semigroup_and_lists = | ||
Chain | ||
(Category) | ||
(Product_category | ||
(Category)(Category_of_monoid(Monoid)(Monoid_of_semigroup)) | ||
(Category_b)(Category_b_of_category | ||
(Category)(Category_of_monoid(Monoid)(List_monoid)))) | ||
[@jane.non_erasable.instances] |
This file contains hidden or 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 @@ | ||
type t |
This file contains hidden or 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,4 @@ | ||
type t = List_element.t list | ||
|
||
let empty = [] | ||
let append = List.append |
This file contains hidden or 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,4 @@ | ||
type t = List_element.t list | ||
|
||
val empty : t | ||
val append : t -> t -> t |
This file contains hidden or 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,27 @@ | ||
module Monoid_utils_of_semigroup = | ||
Monoid_utils(Monoid)(Monoid_of_semigroup) [@jane.non_erasable.instances] | ||
|
||
module Category_utils_of_semigroup = | ||
Category_utils(Category)(Category_of_monoid(Monoid)(Monoid_of_semigroup)) | ||
[@jane.non_erasable.instances] | ||
|
||
module Category_utils_of_list = | ||
Category_utils(Category)(Category_of_monoid(Monoid)(List_monoid)) | ||
[@jane.non_erasable.instances] | ||
|
||
module Category_of_list_monoid = | ||
Category_of_monoid(Monoid)(List_monoid) | ||
[@jane.non_erasable.instances] | ||
|
||
let concat_semi : Monoid_utils_of_semigroup.ts -> Monoid_of_semigroup.t = | ||
Monoid_utils_of_semigroup.concat | ||
|
||
let concat_chain_semi = Category_utils_of_semigroup.concat | ||
|
||
let append3_semi a b c = Category_utils_of_semigroup.concat [ a; b; c ] | ||
|
||
let concat_lists = List.concat | ||
|
||
let concat_chain_lists = Category_utils_of_list.concat | ||
|
||
let append3_lists a b c = concat_chain_lists [ a; b; c ] |
This file contains hidden or 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,19 @@ | ||
open Import | ||
|
||
val append3_semi | ||
: Semigroup.t option | ||
-> Semigroup.t option | ||
-> Semigroup.t option | ||
-> Semigroup.t option | ||
|
||
val concat_semi : Semigroup.t option list -> Monoid_of_semigroup.t | ||
|
||
val concat_chain_semi | ||
: (unit, unit) Chain_of_semigroup.t -> Monoid_of_semigroup.t | ||
|
||
val append3_lists | ||
: List_monoid.t -> List_monoid.t -> List_monoid.t -> List_monoid.t | ||
|
||
val concat_lists : List_monoid.t list -> List_element.t list | ||
|
||
val concat_chain_lists : (_, _) Chain_of_lists.t -> List_element.t list |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.