-
Notifications
You must be signed in to change notification settings - Fork 258
Made Data.Container(.Any/.FreeMonad)
safe by splitting out fixed points
#1513
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
10 commits
Select commit
Hold shift + click to select a range
a12cbd7
Made `Data.Container(.Any/.FreeMonad)` safe by splitting out fixed po…
MatthewDaggitt aa10c2e
Addressed Jacques' feedback
MatthewDaggitt 5625b88
Done the same thing with indexed containers
MatthewDaggitt 3824fa4
[ cleanup ] use variables in Data.W
gallais 87ef066
[ cleanup ] import list of Data.W
gallais dbd33ea
[ new ] sized W types
gallais 75171d4
[ new ] sized & guarded fixpoints
gallais 7030292
[ fix ] annotations
gallais 847dfa7
[ update ] following Matthew's review
gallais d7edf37
Minor tweaks
MatthewDaggitt 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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
------------------------------------------------------------------------ | ||
-- The Agda standard library | ||
-- | ||
-- Fixpoints for containers - using guardedness | ||
------------------------------------------------------------------------ | ||
|
||
{-# OPTIONS --safe --without-K --guardedness #-} | ||
|
||
module Data.Container.Fixpoints.Guarded where | ||
|
||
open import Level using (Level; _⊔_) | ||
open import Codata.Musical.M using (M) | ||
open import Data.Container using (Container) | ||
|
||
private | ||
variable | ||
s p : Level | ||
|
||
-- The least fixpoint can be found in `Data.Container` | ||
|
||
open Data.Container public | ||
using (μ) | ||
|
||
-- This lives in its own module due to its use of guardedness. | ||
|
||
ν : Container s p → Set (s ⊔ p) | ||
ν C = M 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,27 @@ | ||
------------------------------------------------------------------------ | ||
-- The Agda standard library | ||
-- | ||
-- Sized fixpoints of containers, based on the work of Abbott and others | ||
------------------------------------------------------------------------ | ||
|
||
{-# OPTIONS --without-K --sized-types #-} | ||
|
||
module Data.Container.Fixpoints.Sized where | ||
|
||
open import Level | ||
open import Size | ||
open import Codata.M | ||
open import Data.W.Sized | ||
open import Data.Container hiding (μ) public | ||
|
||
private | ||
variable | ||
s p : Level | ||
|
||
-- The sized least and greatest fixpoints of a container. | ||
|
||
μ : Container s p → Size → Set (s ⊔ p) | ||
μ = W | ||
|
||
ν : Container s p → Size → Set (s ⊔ p) | ||
ν = M |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
------------------------------------------------------------------------ | ||
-- The Agda standard library | ||
-- | ||
-- Greatest fixpoint for indexed containers - using guardedness | ||
------------------------------------------------------------------------ | ||
|
||
{-# OPTIONS --safe --without-K --guardedness #-} | ||
|
||
module Data.Container.Indexed.Fixpoints.Guarded where | ||
|
||
open import Level using (Level; _⊔_) | ||
open import Codata.Musical.M.Indexed using (M) | ||
open import Data.Container.Indexed using (Container) | ||
open import Relation.Unary using (Pred) | ||
|
||
private | ||
variable | ||
o c r : Level | ||
O : Set o | ||
|
||
|
||
-- The least fixpoint can be found in `Data.Container` | ||
|
||
open Data.Container.Indexed public | ||
using (μ) | ||
|
||
-- This lives in its own module due to its use of guardedness. | ||
|
||
ν : Container O O c r → Pred O _ | ||
ν = M |
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
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.