Comments (4)
It should work if you put no-eta-equality
.
With eta, foldSS
is not terminating due to the record pattern translation which turns this into
foldSS f s = f (head s) (foldSS f (tail s))
from agda.
This passes:
record SillyStream (A : Set) : Set where
inductive; pattern; constructor _∷_
field head : A
field tail : SillyStream A
foldSS : {A r : Set} → (A → r → r) → SillyStream A → r
foldSS f (head ∷ tail) = f head (foldSS f tail)
from agda.
Yes, because eta is off. This gives an error:
...
module _ (A : Set) (s : SillyStream A) where
eta : s ≡ head s ∷ tail s
eta = refl
from agda.
It seems like pattern
is enough to get data
-style checking of a record
.
I don't think a doc update is required, since the pattern
keyword is discoverable via Agda's error message:
/tmp/tmp.O6kGsXwZPr/tmp.agda:8,11-22
Pattern matching on no-eta record type SillyStream
(defined at /tmp/tmp.O6kGsXwZPr/tmp.agda:2,8-19) is not allowed
(to activate, add declaration `pattern` to record definition)
when checking that the pattern head ∷ tail has type SillyStream A
which arises when I give a naive translation of the data
type:
record SillyStream (A : Set) : Set where
inductive; constructor _∷_
field head : A
field tail : SillyStream A
(Agda version 422b932 of master
)
from agda.
Related Issues (20)
- Some warnings aren't yet covered by our testsuite
- Unexpected hidden argument in nested records/modules HOT 6
- Regression: emptiness check fails when erased constructors are involved HOT 8
- `--exact-split` is not default in 2.7.0, contrary to claims
- Instance missing when abstracting over an incomplete type HOT 3
- Instances found by instance search are inlined HOT 2
- Performance regression caused by making `--save-metas` the default HOT 9
- Both stack and cabal fail to install Agda HOT 5
- Deprecate idiom brackets? HOT 4
- Verbosity options are not picked up from the main module when this module is deserialized unchanged
- Compiled `--erased-cubical` program produces non-deterministic value HOT 3
- Extend the emptiness check to all pattern records? HOT 7
- [bug?] `WARNING_ON_USAGE` in parameterised module/record fails to fire after module instantiation HOT 2
- Unguarded eta records can make Agda loop HOT 1
- Delete or reproduce a check for unsolved metas in Backend.hs HOT 1
- Internal error using Mimer in where block HOT 3
- Instance overlaps with all other instances HOT 6
- Catchall clauses with less arguments are considered exact
- Clauses do not reduce up to eta during termination checking
- Cumulativity `Prop <= Set` loses canonicity HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agda.