Comments (2)
Comment by edwinb
Saturday Dec 07, 2019 at 15:11 GMT
This'd be nice, but would require the normaliser to keep track of a lot of information. I think this is a feature request that's very unlikely to get done, unfortunately. I've added a label, just in case anyone is enthusiastic enough to do it, but my feeling is that it'd be very complicated to achieve.
(My feeling on this sort of thing is often wrong though, so who knows...)
from idris2.
For the record, the typical solution here is to define a view
that has one case for each match of interest & a catchall
constructor for the rest.
Instead of:
foo : s -> ...
foo x = case x of
C => ...
_ => ...
write:
data View s = C | Default
view : (x : s) -> View x
view x = case x of
C => C
_ => Default
foo : s -> ...
foo x with (view x)
foo x | C = ...
foo x | Default = ...
and you can then prove foo
's properties by using the same with (view x)
.
from idris2.
Related Issues (20)
- Type checker does not terminate when comparing codata types. HOT 2
- Remove `=` sugar for propositional Equality HOT 3
- Failure to eliminate pattern case when matching by type HOT 3
- `unsafePerformIO` can be optimized out HOT 4
- Overly eager auto implicit in GADT ctor field's type results in typechecking failure
- Source file "Main.idr" is not in the source directory when invoking compiler with `--source-dir` HOT 2
- [ regression ] `Uninhabited (LTE 1 0)` will no longer be found HOT 2
- `idris2 --init` doesn't check a name of a package
- Totality checker fails to recognize missing cases on irrelevant parameter in irrelevant function HOT 1
- Regression in #3234, backticked infix operators are printed incorrectly HOT 1
- Postfix functions are parsed as if inside unquote when are right after unquote HOT 1
- Remove 'Closed' state from linear network API
- Type checking issue with Idris2 Load instruction in dependent context HOT 1
- Fedora FC38, FC39 with racket 7.9 — "make bootstrap-racket" freezes on compilation HOT 1
- No Nested ":" allowed? HOT 5
- FFI: segfault for conflicting names in C++
- Doc: "Multiplicities" section roadmap HOT 4
- [ bug ] Buggy `Data.Fin.fromInteger` in the presence of negative integer literals HOT 1
- Type information is lost/changed when inlining a function (and it's not clear why) HOT 5
- Inconsistency in totality checker with different constants values and representations
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 idris2.