Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow files without top module #953

Closed
GoogleCodeExporter opened this issue Aug 8, 2015 · 6 comments
Closed

Allow files without top module #953

GoogleCodeExporter opened this issue Aug 8, 2015 · 6 comments
Labels
modules Issues relating to the module system syntax Bike-shedding of the surface syntax type: bug Issues and pull requests about actual bugs
Milestone

Comments

@GoogleCodeExporter
Copy link

GoogleCodeExporter commented Aug 8, 2015

For throw-away Agda files, I would like to be able to omit the

  module JustAThrowAwayFileButModuleNameMustMatchFileNameExactly where

top-level module declaration.

Use cases:

  • little bits of Agda code in a presentation
  • test suite
  • playing, experimentation and demonstration

If no module name is encounterd before the first non-import statement, just the (unqualified) file name is taken as module name.

Original issue reported on code.google.com by andreas....@gmail.com on 12 Nov 2013 at 1:59

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Aug 8, 2015

Allows either omitting the top-level module or defining it as module _ where.

Original comment by ulf.nor...@gmail.com on 13 Nov 2013 at 10:53

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Aug 8, 2015

After the patches, the following module doesn't type-check:

module Foo
where

$ agda Foo.agda
...
Parse error Foo<ERROR> where ...

Original comment by andres.s...@gmail.com on 13 Nov 2013 at 12:27

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Original comment by nils.anders.danielsson on 13 Nov 2013 at 4:26

  • Added labels: Milestone-2.3.4, Priority-High, Type-Defect
  • Removed labels: Type-Enhancement

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Aug 8, 2015

That's by design. Put a space before the where. The top-level is now in a layout context, which makes the syntax more consistent than before (you couldn't write a local module like that before).

Original comment by ulf.nor...@gmail.com on 13 Nov 2013 at 8:34

  • Changed state: Fixed

@GoogleCodeExporter GoogleCodeExporter added type: bug Issues and pull requests about actual bugs auto-migrated modules Issues relating to the module system syntax Bike-shedding of the surface syntax labels Aug 8, 2015
@asr asr modified the milestone: 2.3.4 Aug 16, 2015
andreasabel added a commit that referenced this issue Feb 1, 2016
not allow trailing unindented ones.

Fixes issue introduced by commit f304322
which fixed #953.
@andreasabel
Copy link
Member

Fix for this issue introduced #1388 in commit f304322.
#1388 fixed in 470dbcf.

@andreasabel
Copy link
Member

I admit that dropping the module header altogether did not pass the test of time. It makes recognizing the top-level module too context-dependent. Omitting the name and writing module _ where however seems stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules Issues relating to the module system syntax Bike-shedding of the surface syntax type: bug Issues and pull requests about actual bugs
Projects
None yet
Development

No branches or pull requests

3 participants