Comments (4)
I think, observed behavior is expected documented behaviour since let x = val in e
is documented to be equivalent to (\x => e) val
, and on your case this completely eliminates the whole expression of val
. It does not matter whether it contains unsafePerformIO
or not, the fact that this expression is not computed fully corresponds the language semantics.
from idris2.
this completely eliminates the whole expression of
val
Why is that the case? I understand the let
binding can be transformed to a lambda-expression, but under traditional eager evaluation semantics, a lambda expression should still fully evaluate its arguments before its body can be run, even when the body doesn't use the arguments. Whether it uses a let
binding or a lambda expression shouldn't matter.
from idris2.
under traditional eager evaluation semantics, a lambda expression should still fully evaluate its arguments
Well, that's interesting. I always thought that only functions fully evaluate their arguments, not arbitrary lambda expressions. I always thought that the meaning of a lambda expression is its normal form, and thus applying a lambda expression to an unused argument literally means non-presence of that argument. But maybe I'm wrong in my thoughts, despite I still think my concept is sound.
from idris2.
only functions fully evaluate their arguments, not arbitrary lambda expressions.
The order of argument evaluation in an application should be (observationally) the same for any (eager) expression in the function position. The underlying implementation may use different strategies for different kinds of function expressions, but they should always look the same to the user (for example, always performs the same side effects).
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
- 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 2
- 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.