Giter Site home page Giter Site logo

Opaque by default about agda HOT 5 OPEN

nad avatar nad commented on June 20, 2024 3
Opaque by default

from agda.

Comments (5)

jespercockx avatar jespercockx commented on June 20, 2024

Where would you put the unfolding statement if there is no opaque block? Currently the syntax is:

opaque
  unfolding ...
  x = ...
  y = ...

Without the opaque it would not be clear if the unfolding declaration applies only to x or also to y.

from agda.

nad avatar nad commented on June 20, 2024

If you want to use unfolding, then you should use opaque.

from agda.

nad avatar nad commented on June 20, 2024

This feature request was discussed during a recent developer meeting. Someone (@jespercockx?) suggested that there should also be non-pragma syntax corresponding to --opaque, and @plt-amy suggested that one could use opaque module to make "everything" inside a module opaque. I wonder if it might make sense to instead use attributes for this: one can already use module @0 to make a module erased, perhaps the notation could be module @opaque.

That raises the question of whether one should also allow this notation for individual functions:

@opaque f :

Note that I don't think the possibility to use opaque module or module @opaque makes the flag --opaque pointless: one can put this flag in a project's .agda-lib file to make things opaque by default, similarly to how one can put StrictHaskell in a .cabal file to make code strict by default in a Haskell project.

from agda.

JacquesCarette avatar JacquesCarette commented on June 20, 2024

These proposed extensions sure make a lot sense to me.

from agda.

xekoukou avatar xekoukou commented on June 20, 2024

I don't know the exact functioning of opaque. I believe it abstracts the implementation of a function. It forces the user to manually unfold something.

I agree that it should be the default. I am concerned with teaching people the correct way of programming in agda.
For example, instead of unfolding, would it be better to create an abstraction? How can creating an abstraction be more natural and easy than unfolding?

For example, you have a specific implementation of Integers. And you want to prove something that is only affected by properties of integers being an abelian group. How can we teach/guide people not to unfold and just create the abstraction?

from agda.

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.