pts icon indicating copy to clipboard operation
pts copied to clipboard

Implement section syntax or parameterized modules.

Open Toxaris opened this issue 10 years ago • 3 comments

To avoid long repetitive parameter lists.

Toxaris avatar Jul 23 '14 19:07 Toxaris

Proposal. Desugar this:

forall (x y : A) (z : B) {
  foo = z;
  bar (a b : A) = foo;
}

to this:

foo (x y : A) (z : B) = z;
bar (x y : A) (z : B) (a b : A) = foo x y z;

Toxaris avatar Jul 23 '14 20:07 Toxaris

:+1:

IIUC, forall seems equivalent to Agda's module _. Reusing an existing design, which we even found useful, would be good.

Blaisorblade avatar Jul 24 '14 02:07 Blaisorblade

Yes, both my forall above and Agda's module _ are inspired by Coq's section mechanism. See discussion on the Agda issue tracker.

Toxaris avatar Jul 24 '14 08:07 Toxaris