Skip to content

[ style ] syntax declarations: to be or not to be? #3059

Description

@jamesmckinna

So I couldn't help noticing, while trying to figure out the merge conflicts, that @shhyou 's original proofs made extensive use of the ... ≈[ ... ] ... syntax, whereas the proofs in this PR reinstate the explicit unfolding of that syntax into cast ... ... ≡ ... form.

Is that a Good Idea, or a Bad One?

Otherwise put: is it a style-guide/library-design precept that we don't use syntax explicitly in library modules?

Originally posted by @jamesmckinna in #2431 (comment)

I'm conscious that many/several aspects of syntax declarations (eg we can't really deprecate them, only decline to export them publicly) make their use perhaps more 'controversial'/less straightforward in stdlib library modules than elsewhere:

  • avoiding using them is 'more robust', but harder to read (otherwise we wouldn't introduce them?!)
  • using them is 'more abstract', so avoiding using them exposes implementation details, which may or may not be a good thing, eg
    ∃-syntax :  {A : Set a}  (A  Set b)  Set (a ⊔ b)
    ∃-syntax =syntax ∃-syntax (λ x  B) = ∃[ x ] B
    means that I don't need to see the LHS implementation of what is otherwise, less or more 'opaquely`, some sort of binding syntax,
    but I don't really need to care what that might be... while others seem actively to avoid using them...
  • more/less 'ink': I follow Wadler in favouring less; truly Less is More here ;-)
  • prefix/infix, the eternal debate...
  • ...

Accordingly:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions