Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polymorphise the type of some functions
What I've done is take the prelude functions that we use all the time and polymorphise the higher-order arrows. I left the first order arrow to multiplicity 1 whenever possible because: - We can cast them to any multiplicity by a simple 𝜂-expansion - Any multiplicity involving multiplicity multiplication will hit the limitations of the type checker currently (it doesn't know that multiplication is associative, typically), so I really wanted a single multiplicity variable per type. This does leave composition fully linear, unfortunately, because there are two (independent) higher-order arrow, and there is no most general choice of one to polymorphise. It didn't work last time I tried, but @monoidal made a [cleverly short patch](https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4632) to 9.0 prior to release, and as he hinted to me last week, it does make this polymorphisation possible. Closes #309 .
- Loading branch information
Showing
7 changed files
with
30 additions
and
42 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
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
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