Skip to content

Conversation

@wizard7377
Copy link

Description

Added documentation for Language.Reflection

Self-check


||| `%search`
ISearch : FC -> (depth : Nat) -> TTImp
IAlternative : FC -> AltType -> List TTImp -> TTImp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This operation is for expression that tries to typecheck expression in the list according to the given AltType and return either one of them, or default one (if present in the AltType), or fails

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I'm not familiar with this, I'm just going to copy paste your description if that's alright with you

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's okay

Comment on lines 38 to 43
||| A function type
||| @ Count the multiplicity of the arguement
||| @ PiInfo If the arguement is implicit, explicit, auto implicit or a default implicit
||| @ (Maybe Name) the optional index, such as `x` in `(x : Type) -> Type`
||| @ argTy the type of the argument
||| @ retTy the return type
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the style of tacit docstrings you added in the second half of TTImp, also mentioning expressions in the surface langauge that correspond to constructors of TTImp. I think this style should be appropriate also for these constructors in the beginning of TTImp.

@wizard7377 wizard7377 marked this pull request as ready for review September 1, 2025 13:00
@wizard7377 wizard7377 requested a review from buzden September 1, 2025 13:55
Comment on lines +38 to +39
||| A function type, of the form `(mult binder : argTy) -> retTy`, with implicitness determined by `info`
IPi : FC -> (mult : Count) -> (info : PiInfo TTImp) -> (binder : Maybe Name) ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please change info to piinfo, because info seems to be too generic

Comment on lines +62 to 63
||| A view in a `with` rule
IWithApp : FC -> TTImp -> TTImp -> TTImp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a view. View with with-rule is done through appropriate WithClause consturctor of the Clause data type. IWithApp is an application in form of f | arg which can be used only inside with-clauses.


||| `%search`
ISearch : FC -> (depth : Nat) -> TTImp
IAlternative : FC -> AltType -> List TTImp -> TTImp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's okay

Comment on lines +72 to 74
||| Any implicit bindings in the scope should be bound here, using
||| the given binder
IBindHere : FC -> BindMode -> TTImp -> TTImp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say "A bound for implicit bindings to be automatically bound using the given bind mode"

Comment on lines +84 to +85
||| The delay type, `Delay t`
IDelayed : FC -> LazyReason -> TTImp -> TTImp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delay types are Lazy and Inf (depending on the LazyReason argument). Delay is a constructor of a lazy value, it is of type a -> Lazy a or a -> Inf a depending on the context

INamespace : FC -> Namespace -> (decls : List Decl) -> Decl
||| A transformation declaration
ITransform : FC -> Name -> TTImp -> TTImp -> Decl
||| A top-level elaboration run
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
||| A top-level elaboration run
||| A top-level elaborator script run, `%runElab`

(totality : Maybe TotalReq) -> (rec : Record) -> Decl
||| A namespace declaration, `namespace ns where decls`
INamespace : FC -> Namespace -> (decls : List Decl) -> Decl
||| A transformation declaration
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
||| A transformation declaration
||| A transformation rule declaration

WithDefault Visibility Private ->
Maybe TotalReq -> Record -> Decl
(ns : Maybe String) ->
(vis : WithDefault Visibility Private) ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any need for names here? I suppose, their types are self expanatory and they are not used on the documentation either, so these names, I think, just clutter reading. What do you think?

||| A type ascription, `a : b`.
||| Called a claim because of Curry Howard, the statement `x : p` is equivalent to `x` is a proof of `p`.
IClaim : (claim : WithFC IClaimData) -> Decl
||| A data declaration
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
||| A data declaration
||| A data type declaration

IData : FC -> (vis : WithDefault Visibility Private) -> Maybe TotalReq -> (cons : Data) -> Decl
||| A function definition by its clauses
IDef : FC -> (f : Name) -> (cls : List Clause) -> Decl
||| A parameter block
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest giving an example here, something like

Suggested change
||| A parameter block
||| A parameters block, e.g. `parameters {0 m : _} {auto _ : Monad m} (level : Nat)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants