You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Nix 2.2412, one may write :doc some-function on the Nix REPL (invoked by nix repl) to obtain a function's documentation, specified through a docstring in the format specified by Nix RFC 1453, as follows:
let/** Function doc */func=x: y: x+y;in...
Additionally, in Gleam, we may specify documentation comments on functions through the /// syntax, as follows:
/// Function docpubfnfunc(x:Int,y:Int)->Int{x+y}
When generating the Nix code for this function, it could be nice to translate the Gleam docstring into a Nix docstring so it can be accessed through :doc.
One concern: We'd need to escape */ in the docstring somehow. One way could be to add a whitespace between * and /, but this could be a problem depending on the contents of the docstring.
Since Nix 2.2412, one may write
:doc some-function
on the Nix REPL (invoked bynix repl
) to obtain a function's documentation, specified through a docstring in the format specified by Nix RFC 1453, as follows:Additionally, in Gleam, we may specify documentation comments on functions through the
///
syntax, as follows:When generating the Nix code for this function, it could be nice to translate the Gleam docstring into a Nix docstring so it can be accessed through
:doc
.One concern: We'd need to escape
*/
in the docstring somehow. One way could be to add a whitespace between*
and/
, but this could be a problem depending on the contents of the docstring.Footnotes
https://discourse.nixos.org/t/nix-2-24-released/49986 ↩
https://www.github.com/NixOS/nix/pull/11072 ↩
https://www.github.com/NixOS/rfcs/pull/145 ↩
The text was updated successfully, but these errors were encountered: