anoma / juvix

A language for intent-centric and declarative decentralised applications
https://docs.juvix.org
GNU General Public License v3.0
449 stars 54 forks source link

Consistent named application syntax #3054

Open heueristik opened 1 week ago

heueristik commented 1 week ago

Request: Allow consistent use of the named syntax.

Context: I defined named function arguments in a trait and the instance

trait
type AdditivelyHomomorphic T := mkAdditivelyHomomorphic {add : (v1 : T) -> (v2 : T) -> T};

Property-AdditivelyHomomorphic
  {T} {{Eq T}} {{AdditivelyHomomorphic T}} (f : T -> T) (v1 v2 : T) : Bool :=
  f (AdditivelyHomomorphic.add v1 v2) == AdditivelyHomomorphic.add (f v1) (f v2);

but couldn't use the named application syntax afterwards. When trying, I got an The identifier AdditivelyHomomorphic.add does not have a type signature with named arguments Error.

Bildschirmfoto 2024-09-20 um 15 18 46

Steps to reproduce:

  1. clone and install deps of https://github.com/anoma/juvix-arm-specs
  2. Go to Anoma/Transaction/Types.juvix#L33-L38 and try to use the named syntax.