query
On this page

oneOf

lib.types.oneOf

Docs pulled from | This Revision | 9 days ago


Nixpkgs manual

Any of the types in the given list

Noogle detected

Implementation

The following is the current implementation of this function.

oneOf =
    ts:
    let
      head' =
        if ts == [ ] then throw "types.oneOf needs to get at least one type in its argument" else head ts;
    in
    foldl' either head' (tail ts);