Skip to content

Instantly share code, notes, and snippets.

@danielphan2003
Created August 20, 2022 21:33
Show Gist options
  • Save danielphan2003/1cea56ef4ad92be33fc03c616cdb1801 to your computer and use it in GitHub Desktop.
Save danielphan2003/1cea56ef4ad92be33fc03c616cdb1801 to your computer and use it in GitHub Desktop.

Revisions

  1. danielphan2003 created this gist Aug 20, 2022.
    15 changes: 15 additions & 0 deletions implicit.nix
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    {
    a = implicit attrs; /*
    implicit means it has to be accessed via `args.<implicit>`
    Normally you can use `f = {implicit, ...}@args: implicit`,
    but what if `f` is within the following function:
    ```nix
    {implicit}: {
    f = {implicit, ...}@args: implicit;
    }
    ```
    As you can see, we can't reasonably tell the scope of `implicit`,
    so it is best to avoid explicit mentions unless top-level `functionArgs`
    and current scope's does not intersect.
    */
    }