Skip to content

Commit

Permalink
lib/types: deprecate functor.wrapped in types.listOf
Browse files Browse the repository at this point in the history
  • Loading branch information
hsjobeki committed Jan 6, 2025
1 parent 8523f61 commit 5782ef8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/release-notes/rl-2505.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
`functor` is an implementation detail and should not be relied upon, but since its status wasn't clear and it has had some use cases without alternatives, changes are being handled as gracefully as possible. Deprecations within functor:
- `functor.wrapped` is now deprecated for some types and using it will give a warning with migration instructions. It is deprecated for these types:
- `lib.types.attrsWith`
- `lib.types.listOf`
4 changes: 3 additions & 1 deletion lib/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,9 @@ rec {
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["*"]);
getSubModules = elemType.getSubModules;
substSubModules = m: listOf (elemType.substSubModules m);
functor = (defaultFunctor name) // { wrapped = elemType; };
functor = (elemTypeFunctor name { inherit elemType; }) // {
type = payload: types.listOf payload.elemType;
};
nestedTypes.elemType = elemType;
};

Expand Down

0 comments on commit 5782ef8

Please sign in to comment.