AlgebraicJulia / GATlab.jl

GATlab: a computer algebra system based on generalized algebraic theories (GATs)
https://algebraicjulia.github.io/GATlab.jl/
MIT License
23 stars 2 forks source link

Theory Macro should accept docstrings #82

Closed jpfairbanks closed 11 months ago

jpfairbanks commented 11 months ago

In order to document a module created by a macro, you need to put the docs after the thing you document.

@theory ThClass begin
  Ob::TYPE ⊣ []
end

@doc """    ThClass

A Class is just a Set that doesn't worry about foundations.

""" ThClass

But it would be nice to do:

@theory """    ThClass

A Class is just a Set that doesn't worry about foundations.

""" ThClass begin
  Ob::TYPE ⊣ []
end

or

@theory ThClass
@doc """    ThClass

A Class is just a Set that doesn't worry about foundations.

""" begin
  Ob::TYPE ⊣ []
end

or something like that.

epatters commented 11 months ago

I assume this will work like it currently does in Catlab:

"""    ThClass

A Class is just a Set that doesn't worry about foundations.

"""
@theory ThClass begin
  Ob::TYPE ⊣ []
end