-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In scope-passing style: use a
Movable b
instead of Ur b
Functions of the form ```haskell f :: (A %1 -> Ur b) %1 -> Ur b ``` are now of the form ```haskell f :: Movable b => (A %1 -> b) %1 -> b ``` The new type is strictly more general. Technically this seems to involve some extra allocations here and there. I expect it to be negligible (we don't want to call too many scoped functions anyway). The extra allocation is interesting, in that it's not always strictly necessary: when returning an `Int`, I don't need to produce an `Ur Int` to make sure that I've actually forced everything, just returning the forced `Int` would do the trick. Yet we use an `Ur Int` to communicate that we've indeed done the job (in some cases the optimiser can actually remove the extra allocation, but not in every case as far as I can tell). Maybe there are cheaper way to tell the compiler that we've, in fact, moved the value. But that's a question for the future. See #468 for the initial discussion.
- Loading branch information
Showing
6 changed files
with
49 additions
and
30 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