Comments (4)
Very interesting to learn these details, @andreasabel .
Unfortunately, your suggestion may require me to double-down on the request, in order to include syntax
declarations whose LHS are/evaluate to patterns... would that be possible/desirable? UPDATED: on reflection, is this in fact a distinct feature request (syntax
declarations whose LHS are in pattern form should be understood as defining pattern synonyms in their own right for the corresponding RHS) which could be uncoupled from the one above (and even be implemented first)?
Use case: suppose I have an infix constructor _⊗_
for eg transitivity of a relation R
, such as
_⊗_ : R a b → R b c → R a c
but there are times when I might wish, during pattern matching, to expose the 'middle' argument b
explicitly...
At the moment, I can suffer by writing _⊗_ {b = b} aRb bRc
as a pattern, or I can simply write
infix ... _⊗[_]_
pattern aRb ⊗[ b ] bRc = _⊗_ {b = b} aRb bRc
because untyped pattern
syntax won't care about the ill-typed out-of-order arguments (I'm ignoring any fastidiousness about putting the implicit arguments in, for completeness' sake, and in the event I might actually need to refer to them by name, as well).
I'm tempted to argue, from a ux point of view, that this ought to be a common case for 'informal' mathematical notations... and so want not to oblige the user to degrade immediately to some horrible prefix combination of (named) implicits and explicit arguments... (?)
But if pattern synonyms must be declared typed, do I now need in fact to make the above a syntax
declaration instead, to obtain out-of-order binding of the telescope... and currently, IIUC, agda
won't accept (the RHSs of) syntax
declarations as potential pattern synonyms...?
Sorry if my ignorance of agda
internals (and hence, at the moment, it's unlikely that I would be in a position to raise a PR solving these problems... :-() leads me to 'unreasonable' demands from a user/ux point of view, but... 'feature request' ... leading to feature creep ;-)
from agda.
@UlfNorell : The milestone 2.6.5 seems bold given that pattern synonyms currently only exist on the level of abstract syntax, but evaluation is in internal syntax. (We certainly do not want fake evaluation on the AST.)
A prerequisite for this feature seems to move pattern synonyms to internal syntax, e.g., by finishing the stalled PR
from agda.
Interesting observation, James @jamesmckinna !
So to get typed pattern synonyms, we would also need some kind of "simultaneous telescopes".
from agda.
Not sure I quite understand the idea of
... to get typed pattern synonyms, we would also need some kind of "simultaneous telescopes".
Is this to handle the out-of-order behaviour currently achievable with pattern
and syntax
? One telescope for the 'correct' order, and one for the 'permuted' user-supplied version? I hadn't imagined that that would be necessary? (But then, I'm not really sure what would be required... ;-))
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.