Giter Site home page Giter Site logo

Comments (5)

jespercockx avatar jespercockx commented on September 24, 2024

@plt-amy is this intentional? Could you please take a look?

from agda.

plt-amy avatar plt-amy commented on September 24, 2024

This also happens if MyList is marked abstract. I think it's perfectly sensible: Agda doesn't track polarities in types (yet), so as far as the positivity checker is concerned, MyList is Just Some Set → Set. But I suppose I could be talked down from this position, and the fix is simple..

from agda.

andreasabel avatar andreasabel commented on September 24, 2024

Maybe it makes sense for abstract, which is kind of trying to prevent any information about the abstract thing to leak (but no one uses it for that purpose).
If opaque is an explicit mechanism mainly to prevent unwanted unfoldings, it could allow positivity information to get out...

from agda.

plt-amy avatar plt-amy commented on September 24, 2024

Like I said, my view could be swayed! I don't think it makes much sense for the positivity checker to see through opaque definitions like this, but since we don't support opaque data types (hence there would be no way to unfold MyList in the definition of B), it would be a sensible stop-gap.

from agda.

flupe avatar flupe commented on September 24, 2024

I agree that the positivity checker should probably not know this by default, and positivity information should ideally be expressed intentionally in the type of opaque definitions with polarity annotations. Since they are not available (yet), an alternative could be to repurpose the POLARITY pragma for opaque definitions to explicitly decide whether to expose this information to the positivity checker.

opaque
  MyList : Set  Set
  MyList = List

  {-# POLARITY MyList ++ #-}

Could be coupled with a check that enforces that the given polarities do hold, in order to still allow this with --safe.

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.