GithubHelp home page GithubHelp logo

Comments (4)

buzden avatar buzden commented on June 10, 2024

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.

rvs314 avatar rvs314 commented on June 10, 2024

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.

buzden avatar buzden commented on June 10, 2024

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.

rvs314 avatar rvs314 commented on June 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.