lib: update type signatures

- concrete types start with uppercase: Int, String, Bool, Derivation,
  etc.
- type variables start with lowercase: a, b, etc.
- list:
  - use `[x]` for homogeneous lists instead of `List x` or `[ x ]`
  - use `List` for heterogeneous lists (not that common in `lib`)
- attr:
  - use `AttrSet` for a generic attribute set type
  - use `{ key1 :: Type1; key2 :: Type2; ... }` for adding signatures
    for known attribute names and types
  - use `{ key1 = value1; key2 = value2; ... }` for adding attributes
    with known literals
  - end with an ellipsis (`...`) if the set can contain unknown
    attributes
  - use `{ [String] :: x }` if all the attributes has the same type `x`
- prefer `Any` over `a` if the latter is not reused
This commit is contained in:
İlkecan Bozdoğan
2026-03-03 18:12:20 +03:00
parent 64a8ada54e
commit e394a579b0
27 changed files with 505 additions and 341 deletions

View File

@@ -70,7 +70,7 @@ rec {
# Type # Type
``` ```
assertOneOf :: String -> ComparableVal -> List ComparableVal -> Bool assertOneOf :: String -> ComparableVal -> [ComparableVal] -> Bool
``` ```
# Examples # Examples
@@ -115,7 +115,7 @@ rec {
# Type # Type
``` ```
assertEachOneOf :: String -> List ComparableVal -> List ComparableVal -> Bool assertEachOneOf :: String -> [ComparableVal] -> [ComparableVal] -> Bool
``` ```
# Examples # Examples
@@ -164,7 +164,7 @@ rec {
# Type # Type
``` ```
checkAssertWarn :: [ { assertion :: Bool; message :: String } ] -> [ String ] -> Any -> Any checkAssertWarn :: [{ assertion :: Bool; message :: String; }] -> [String] -> a -> a
``` ```
# Examples # Examples

View File

@@ -201,7 +201,7 @@ rec {
# Type # Type
``` ```
longestValidPathPrefix :: [String] -> Value -> [String] longestValidPathPrefix :: [String] -> AttrSet -> [String]
``` ```
# Examples # Examples
@@ -352,7 +352,7 @@ rec {
# Type # Type
``` ```
concatMapAttrs :: (String -> a -> AttrSet) -> AttrSet -> AttrSet concatMapAttrs :: (String -> Any -> AttrSet) -> AttrSet -> AttrSet
``` ```
# Examples # Examples
@@ -514,7 +514,7 @@ rec {
# Type # Type
``` ```
attrVals :: [String] -> AttrSet -> [Any] attrVals :: [String] -> { [String] :: a } -> [a]
``` ```
# Examples # Examples
@@ -537,7 +537,7 @@ rec {
# Type # Type
``` ```
attrValues :: AttrSet -> [Any] attrValues :: { [String] :: a } -> [a]
``` ```
# Examples # Examples
@@ -570,7 +570,7 @@ rec {
# Type # Type
``` ```
getAttrs :: [String] -> AttrSet -> AttrSet getAttrs :: [String] -> { [String] :: a } -> { [String] :: a }
``` ```
# Examples # Examples
@@ -603,7 +603,7 @@ rec {
# Type # Type
``` ```
catAttrs :: String -> [AttrSet] -> [Any] catAttrs :: String -> [{ [String] :: a }] -> [a]
``` ```
# Examples # Examples
@@ -646,7 +646,7 @@ rec {
# Type # Type
``` ```
filterAttrs :: (String -> Any -> Bool) -> AttrSet -> AttrSet filterAttrs :: (String -> a -> Bool) -> { [String] :: a } -> { [String] :: a }
``` ```
# Examples # Examples
@@ -737,7 +737,7 @@ rec {
# Type # Type
``` ```
foldlAttrs :: ( a -> String -> b -> a ) -> a -> { ... :: b } -> a foldlAttrs :: ( a -> String -> b -> a ) -> a -> { [String] :: b } -> a
``` ```
# Examples # Examples
@@ -812,7 +812,7 @@ rec {
# Type # Type
``` ```
foldAttrs :: (Any -> Any -> Any) -> Any -> [AttrSets] -> Any foldAttrs :: (a -> b -> b) -> b -> [{ [String] :: a }] -> { [String] :: b }
``` ```
# Examples # Examples
@@ -850,7 +850,7 @@ rec {
# Type # Type
``` ```
collect :: (AttrSet -> Bool) -> AttrSet -> [x] collect :: (AttrSet -> Bool) -> AttrSet -> [Any]
``` ```
# Examples # Examples
@@ -889,7 +889,7 @@ rec {
# Type # Type
``` ```
cartesianProduct :: AttrSet -> [AttrSet] cartesianProduct :: { [String] :: [a] } -> [{ [String] :: a }]
``` ```
# Examples # Examples
@@ -934,7 +934,7 @@ rec {
# Type # Type
``` ```
mapCartesianProduct :: (AttrSet -> a) -> AttrSet -> [a] mapCartesianProduct :: ({ [String] :: a } -> b) -> { [String] :: a } -> [b]
``` ```
# Examples # Examples
@@ -966,7 +966,7 @@ rec {
# Type # Type
``` ```
nameValuePair :: String -> Any -> { name :: String; value :: Any; } nameValuePair :: String -> a -> { name :: String; value :: a; }
``` ```
# Examples # Examples
@@ -998,7 +998,7 @@ rec {
# Type # Type
``` ```
mapAttrs :: (String -> Any -> Any) -> AttrSet -> AttrSet mapAttrs :: (String -> a -> b) -> { [String] :: a } -> { [String] :: b }
``` ```
# Examples # Examples
@@ -1033,7 +1033,7 @@ rec {
# Type # Type
``` ```
mapAttrs' :: (String -> Any -> { name :: String; value :: Any; }) -> AttrSet -> AttrSet mapAttrs' :: (String -> a -> { name :: String; value :: b; }) -> { [String] :: a } -> { [String] :: b }
``` ```
# Examples # Examples
@@ -1067,7 +1067,7 @@ rec {
# Type # Type
``` ```
mapAttrsToList :: (String -> a -> b) -> AttrSet -> [b] mapAttrsToList :: (String -> a -> b) -> { [String] :: a } -> [b]
``` ```
# Examples # Examples
@@ -1113,7 +1113,7 @@ rec {
# Type # Type
``` ```
attrsToList :: AttrSet -> [ { name :: String; value :: Any; } ] attrsToList :: { [String] :: a } -> [{ name :: String; value :: a; }]
``` ```
# Examples # Examples
@@ -1327,7 +1327,7 @@ rec {
# Type # Type
``` ```
genAttrs :: [ String ] -> (String -> Any) -> AttrSet genAttrs :: [String] -> (String -> a) -> { [String] :: a }
``` ```
# Examples # Examples
@@ -1364,7 +1364,7 @@ rec {
# Type # Type
``` ```
genAttrs' :: [ Any ] -> (Any -> { name :: String; value :: Any; }) -> AttrSet genAttrs' :: [a] -> (a -> { name :: String; value :: b; }) -> { [String] :: b }
``` ```
# Examples # Examples
@@ -1498,7 +1498,7 @@ rec {
# Type # Type
``` ```
zipAttrsWithNames :: [ String ] -> (String -> [ Any ] -> Any) -> [ AttrSet ] -> AttrSet zipAttrsWithNames :: [String] -> (String -> [a] -> b) -> [{ [String] :: a }] -> { [String] :: b }
``` ```
# Examples # Examples
@@ -1533,7 +1533,7 @@ rec {
# Type # Type
``` ```
zipAttrsWith :: (String -> [ Any ] -> Any) -> [ AttrSet ] -> AttrSet zipAttrsWith :: (String -> [a] -> b) -> [{ [String] :: a }] -> { [String] :: b }
``` ```
# Examples # Examples
@@ -1558,7 +1558,7 @@ rec {
# Type # Type
``` ```
zipAttrs :: [ AttrSet ] -> AttrSet zipAttrs :: [{ [String] :: a }] -> { [String] :: [a] }
``` ```
# Examples # Examples
@@ -1589,7 +1589,7 @@ rec {
# Type # Type
``` ```
mergeAttrsList :: [ Attrs ] -> Attrs mergeAttrsList :: [AttrSet] -> AttrSet
``` ```
# Examples # Examples
@@ -1609,7 +1609,7 @@ rec {
list: list:
let let
# `binaryMerge start end` merges the elements at indices `index` of `list` such that `start <= index < end` # `binaryMerge start end` merges the elements at indices `index` of `list` such that `start <= index < end`
# Type: Int -> Int -> Attrs # Type: Int -> Int -> AttrSet
binaryMerge = binaryMerge =
start: end: start: end:
# assert start < end; # Invariant # assert start < end; # Invariant
@@ -1669,7 +1669,7 @@ rec {
# Type # Type
``` ```
recursiveUpdateUntil :: ( [ String ] -> AttrSet -> AttrSet -> Bool ) -> AttrSet -> AttrSet -> AttrSet recursiveUpdateUntil :: ([String] -> AttrSet -> AttrSet -> Bool) -> AttrSet -> AttrSet -> AttrSet
``` ```
# Examples # Examples

View File

@@ -626,7 +626,7 @@ rec {
# Type # Type
``` ```
makeScope :: (AttrSet -> ((AttrSet -> a) | Path) -> AttrSet -> a) -> (AttrSet -> AttrSet) -> scope makeScope :: (AttrSet -> ((AttrSet -> a) | Path) -> AttrSet -> a) -> (AttrSet -> AttrSet) -> Scope
``` ```
*/ */
makeScope = makeScope =
@@ -689,20 +689,20 @@ rec {
``` ```
makeScopeWithSplicing' :: makeScopeWithSplicing' ::
{ splicePackages :: Splice -> AttrSet { splicePackages :: Splice -> AttrSet;
, newScope :: AttrSet -> ((AttrSet -> a) | Path) -> AttrSet -> a newScope :: AttrSet -> ((AttrSet -> a) | Path) -> AttrSet -> a;
} }
-> { otherSplices :: Splice, keep :: AttrSet -> AttrSet, extra :: AttrSet -> AttrSet } -> { otherSplices :: Splice; keep :: AttrSet -> AttrSet; extra :: AttrSet -> AttrSet; }
-> AttrSet -> AttrSet
Splice :: Splice :: {
{ pkgsBuildBuild :: AttrSet pkgsBuildBuild :: AttrSet;
, pkgsBuildHost :: AttrSet pkgsBuildHost :: AttrSet;
, pkgsBuildTarget :: AttrSet pkgsBuildTarget :: AttrSet;
, pkgsHostHost :: AttrSet pkgsHostHost :: AttrSet;
, pkgsHostTarget :: AttrSet pkgsHostTarget :: AttrSet;
, pkgsTargetTarget :: AttrSet pkgsTargetTarget :: AttrSet;
} }
``` ```
*/ */
makeScopeWithSplicing' = makeScopeWithSplicing' =
@@ -806,17 +806,16 @@ rec {
``` ```
extendMkDerivation :: extendMkDerivation ::
{ {
constructDrv :: ((FixedPointArgs | AttrSet) -> a) constructDrv :: (FixedPointArgs | AttrSet) -> Derivation;
excludeDrvArgNames :: [ String ], excludeDrvArgNames :: [String];
excludeFunctionArgNames :: [ String ] excludeFunctionArgNames :: [String];
extendDrvArgs :: (AttrSet -> AttrSet -> AttrSet) extendDrvArgs :: AttrSet -> AttrSet -> AttrSet;
inheritFunctionArgs :: Bool, inheritFunctionArgs :: Bool;
transformDrv :: a -> a, transformDrv :: Derivation -> Derivation;
} }
-> (FixedPointArgs | AttrSet) -> a -> ((FixedPointArgs | AttrSet) -> Derivation)
FixedPointArgs = AttrSet -> AttrSet FixedPointArgs :: AttrSet -> AttrSet
a = Derivation when defining a build helper
``` ```
# Examples # Examples
@@ -998,7 +997,21 @@ rec {
# Type # Type
``` ```
mapCrossIndex :: (a -> b) -> AttrSet -> AttrSet mapCrossIndex :: (a -> b) -> {
buildBuild :: a;
buildHost :: a;
buildTarget :: a;
hostHost :: a;
hostTarget :: a;
targetTarget :: a;
} -> {
buildBuild :: b;
buildHost :: b;
buildTarget :: b;
hostHost :: b;
hostTarget :: b;
targetTarget :: b;
}
``` ```
# Examples # Examples

View File

@@ -60,7 +60,7 @@ rec {
# Type # Type
``` ```
traceIf :: bool -> string -> a -> a traceIf :: Bool -> String -> a -> a
``` ```
# Examples # Examples
@@ -327,7 +327,7 @@ rec {
# Type # Type
``` ```
traceValSeqNFn :: (a -> b) -> int -> a -> a traceValSeqNFn :: (a -> b) -> Int -> a -> a
``` ```
# Examples # Examples
@@ -362,7 +362,7 @@ rec {
# Type # Type
``` ```
traceValSeqN :: int -> a -> a traceValSeqN :: Int -> a -> a
``` ```
# Examples # Examples
@@ -407,7 +407,7 @@ rec {
# Type # Type
``` ```
traceFnSeqN :: int -> string -> (a -> b) -> a -> b traceFnSeqN :: Int -> String -> (a -> b) -> a -> b
``` ```
# Examples # Examples
@@ -466,7 +466,7 @@ rec {
``` ```
runTests :: { runTests :: {
tests = [ String ]; tests :: [String];
${testName} :: { ${testName} :: {
expr :: a; expr :: a;
expected :: a; expected :: a;
@@ -566,7 +566,7 @@ rec {
]; ];
} }
-> ->
null Null
``` ```
# Examples # Examples

View File

@@ -195,7 +195,7 @@ in
# Type # Type
``` ```
optionalDrvAttr :: Bool -> a -> a | Null optionalDrvAttr :: Bool -> a -> (a | Null)
``` ```
# Examples # Examples
@@ -236,7 +236,7 @@ in
# Type # Type
``` ```
warnOnInstantiate :: string -> Derivation -> Derivation warnOnInstantiate :: String -> Derivation -> Derivation
``` ```
# Examples # Examples

View File

@@ -45,7 +45,7 @@ rec {
# Type # Type
``` ```
normalizeHash :: { hashTypes :: List String, required :: Bool } -> AttrSet -> AttrSet normalizeHash :: { hashTypes :: [String]; required :: Bool; } -> AttrSet -> AttrSet
``` ```
# Arguments # Arguments
@@ -157,7 +157,7 @@ rec {
# Type # Type
``` ```
withNormalizedHash :: { hashTypes :: List String } -> (AttrSet -> T) -> (AttrSet -> T) withNormalizedHash :: { hashTypes :: [String]; } -> (AttrSet -> a) -> (AttrSet -> a)
``` ```
# Arguments # Arguments

View File

@@ -139,8 +139,15 @@ rec {
_noEval = throw _noEvalMessage; _noEval = throw _noEvalMessage;
}; };
# Create a fileset, see ./README.md#fileset /**
# Type: path -> filesetTree -> fileset Create a fileset, see ./README.md#fileset
# Type
```
_create :: Path -> FileSetTree -> FileSet
```
*/
_create = _create =
base: tree: base: tree:
let let
@@ -165,12 +172,18 @@ rec {
_noEval = throw _noEvalMessage; _noEval = throw _noEvalMessage;
}; };
# Coerce a value to a fileset. Return a set containing the attribute `success` /**
# indicating whether coercing succeeded, and either `value` when `success == Coerce a value to a fileset. Return a set containing the attribute `success`
# true`, or an error `message` when `success == false`. The string gives the indicating whether coercing succeeded, and either `value` when `success ==
# context for error messages. true`, or an error `message` when `success == false`. The string gives the
# context for error messages.
# Type: String -> (fileset | Path) -> { success :: Bool, value :: fileset } ] -> { success :: Bool, message :: String }
# Type
```
_coerceResult :: String -> (FileSet | Path) -> ({ success :: Bool; value :: FileSet; } | { success :: Bool; message :: String; })
```
*/
_coerceResult = _coerceResult =
let let
ok = value: { ok = value: {
@@ -219,9 +232,16 @@ rec {
else else
ok (_singleton value); ok (_singleton value);
# Coerce a value to a fileset, erroring when the value cannot be coerced. /**
# The string gives the context for error messages. Coerce a value to a fileset, erroring when the value cannot be coerced.
# Type: String -> (fileset | Path) -> fileset The string gives the context for error messages.
# Type
```
_coerce :: String -> (FileSet | Path) -> FileSet
```
*/
_coerce = _coerce =
context: value: context: value:
let let
@@ -229,9 +249,16 @@ rec {
in in
if result.success then result.value else throw result.message; if result.success then result.value else throw result.message;
# Coerce many values to filesets, erroring when any value cannot be coerced, /**
# or if the filesystem root of the values doesn't match. Coerce many values to filesets, erroring when any value cannot be coerced,
# Type: String -> [ { context :: String, value :: fileset | Path } ] -> [ fileset ] or if the filesystem root of the values doesn't match.
# Type
```
_coerceMany :: String -> [{ context :: String; value :: FileSet | Path; }] -> [FileSet]
```
*/
_coerceMany = _coerceMany =
functionContext: list: functionContext: list:
let let
@@ -259,8 +286,15 @@ rec {
else else
filesets; filesets;
# Create a file set from a path. /**
# Type: Path -> fileset Create a file set from a path.
# Type
```
_singleton :: Path -> FileSet
```
*/
_singleton = _singleton =
path: path:
let let
@@ -279,9 +313,16 @@ rec {
${baseNameOf path} = type; ${baseNameOf path} = type;
}; };
# Expand a directory representation to an equivalent one in attribute set form. /**
# All directory entries are included in the result. Expand a directory representation to an equivalent one in attribute set form.
# Type: Path -> filesetTree -> { <name> = filesetTree; } All directory entries are included in the result.
# Type
```
_directoryEntries :: Path -> FileSetTree -> { [String] :: FileSetTree }
```
*/
_directoryEntries = _directoryEntries =
path: value: path: value:
if value == "directory" then if value == "directory" then
@@ -312,7 +353,7 @@ rec {
# Type # Type
``` ```
Path -> filesetTree -> filesetTree _normaliseTreeFilter :: Path -> FileSetTree -> FileSetTree
``` ```
*/ */
_normaliseTreeFilter = _normaliseTreeFilter =
@@ -357,7 +398,7 @@ rec {
# Type # Type
``` ```
Path -> filesetTree -> filesetTree (with "emptyDir"'s) _normaliseTreeMinimal :: Path -> FileSetTree -> FileSetTree (with "emptyDir"'s)
``` ```
*/ */
_normaliseTreeMinimal = _normaliseTreeMinimal =
@@ -391,9 +432,16 @@ rec {
else else
tree; tree;
# Trace a filesetTree in a pretty way when the resulting value is evaluated. /**
# This can handle both normal filesetTree's, and ones returned from _normaliseTreeMinimal Trace a filesetTree in a pretty way when the resulting value is evaluated.
# Type: Path -> filesetTree (with "emptyDir"'s) -> Null This can handle both normal filesetTree's, and ones returned from _normaliseTreeMinimal
# Type
```
_printMinimalTree :: Path -> FileSetTree (with "emptyDir"'s) -> Null
```
*/
_printMinimalTree = _printMinimalTree =
base: tree: base: tree:
let let
@@ -443,8 +491,15 @@ rec {
in in
if isAttrs tree then traceTreeAttrs firstLine "" tree else firstLine; if isAttrs tree then traceTreeAttrs firstLine "" tree else firstLine;
# Pretty-print a file set in a pretty way when the resulting value is evaluated /**
# Type: fileset -> Null Pretty-print a file set in a pretty way when the resulting value is evaluated
# Type
```
_printFileset :: FileSet -> Null
```
*/
_printFileset = _printFileset =
fileset: fileset:
if fileset._internalIsEmptyWithoutBase then if fileset._internalIsEmptyWithoutBase then
@@ -454,9 +509,16 @@ rec {
_normaliseTreeMinimal fileset._internalBase fileset._internalTree _normaliseTreeMinimal fileset._internalBase fileset._internalTree
); );
# Turn a fileset into a source filter function suitable for `builtins.path` /**
# Only directories recursively containing at least one files are recursed into Turn a fileset into a source filter function suitable for `builtins.path`
# Type: fileset -> (String -> String -> Bool) Only directories recursively containing at least one files are recursed into
# Type
```
_toSourceFilter :: FileSet -> (String -> String -> Bool)
```
*/
_toSourceFilter = _toSourceFilter =
fileset: fileset:
let let
@@ -476,7 +538,7 @@ rec {
# Check whether a list of path components under the base path exists in the tree. # Check whether a list of path components under the base path exists in the tree.
# This function is called often, so it should be fast. # This function is called often, so it should be fast.
# Type: [ String ] -> Bool # Type: [String] -> Bool
inTree = inTree =
components: components:
let let
@@ -551,10 +613,17 @@ rec {
# This also forces the tree before returning the filter, leads to earlier error messages # This also forces the tree before returning the filter, leads to earlier error messages
if fileset._internalIsEmptyWithoutBase || tree == null then empty else nonEmpty; if fileset._internalIsEmptyWithoutBase || tree == null then empty else nonEmpty;
# Turn a builtins.filterSource-based source filter on a root path into a file set /**
# containing only files included by the filter. Turn a builtins.filterSource-based source filter on a root path into a file set
# The filter is lazily called as necessary to determine whether paths are included containing only files included by the filter.
# Type: Path -> (String -> String -> Bool) -> fileset The filter is lazily called as necessary to determine whether paths are included
# Type
```
_fromSourceFilter :: Path -> (String -> String -> Bool) -> FileSet
```
*/
_fromSourceFilter = _fromSourceFilter =
root: sourceFilter: root: sourceFilter:
let let
@@ -606,8 +675,15 @@ rec {
${baseNameOf root} = rootPathType; ${baseNameOf root} = rootPathType;
}; };
# Turns a file set into the list of file paths it includes. /**
# Type: fileset -> [ Path ] Turns a file set into the list of file paths it includes.
# Type
```
_toList :: FileSet -> [Path]
```
*/
_toList = _toList =
fileset: fileset:
let let
@@ -668,9 +744,16 @@ rec {
in in
recurse (length fileset._internalBaseComponents) fileset._internalTree; recurse (length fileset._internalBaseComponents) fileset._internalTree;
# Computes the union of a list of filesets. /**
# The filesets must already be coerced and validated to be in the same filesystem root Computes the union of a list of filesets.
# Type: [ Fileset ] -> Fileset The filesets must already be coerced and validated to be in the same filesystem root
# Type
```
_unionMany :: [FileSet] -> FileSet
```
*/
_unionMany = _unionMany =
filesets: filesets:
let let
@@ -715,9 +798,16 @@ rec {
# If there's no values with a base, we have no files # If there's no values with a base, we have no files
if filesetsWithBase == [ ] then _emptyWithoutBase else _create commonBase resultTree; if filesetsWithBase == [ ] then _emptyWithoutBase else _create commonBase resultTree;
# The union of multiple filesetTree's with the same base path. /**
# Later elements are only evaluated if necessary. The union of multiple filesetTree's with the same base path.
# Type: [ filesetTree ] -> filesetTree Later elements are only evaluated if necessary.
# Type
```
_unionTrees :: [FileSetTree] -> FileSetTree
```
*/
_unionTrees = _unionTrees =
trees: trees:
let let
@@ -736,9 +826,16 @@ rec {
# We need to recurse into those # We need to recurse into those
zipAttrsWith (name: _unionTrees) withoutNull; zipAttrsWith (name: _unionTrees) withoutNull;
# Computes the intersection of a list of filesets. /**
# The filesets must already be coerced and validated to be in the same filesystem root Computes the intersection of two filesets.
# Type: Fileset -> Fileset -> Fileset The filesets must already be coerced and validated to be in the same filesystem root
# Type
```
_intersection :: FileSet -> FileSet -> FileSet
```
*/
_intersection = _intersection =
fileset1: fileset2: fileset1: fileset2:
let let
@@ -787,9 +884,16 @@ rec {
else else
_create longestBaseFileset._internalBase resultTree; _create longestBaseFileset._internalBase resultTree;
# The intersection of two filesetTree's with the same base path /**
# The second element is only evaluated as much as necessary. The intersection of two filesetTree's with the same base path
# Type: filesetTree -> filesetTree -> filesetTree The second element is only evaluated as much as necessary.
# Type
```
_intersectTree :: FileSetTree -> FileSetTree -> FileSetTree
```
*/
_intersectTree = _intersectTree =
lhs: rhs: lhs: rhs:
if isAttrs lhs && isAttrs rhs then if isAttrs lhs && isAttrs rhs then
@@ -804,9 +908,16 @@ rec {
# In all other cases it's the rhs # In all other cases it's the rhs
rhs; rhs;
# Compute the set difference between two file sets. /**
# The filesets must already be coerced and validated to be in the same filesystem root. Compute the set difference between two file sets.
# Type: Fileset -> Fileset -> Fileset The filesets must already be coerced and validated to be in the same filesystem root.
# Type
```
_difference :: FileSet -> FileSet -> FileSet
```
*/
_difference = _difference =
positive: negative: positive: negative:
let let
@@ -862,8 +973,15 @@ rec {
# which is what base path is for # which is what base path is for
_create positive._internalBase resultingTree; _create positive._internalBase resultingTree;
# Computes the set difference of two filesetTree's /**
# Type: Path -> filesetTree -> filesetTree Computes the set difference of two filesetTree's
# Type
```
_differenceTree :: Path -> FileSetTree -> FileSetTree -> FileSetTree
```
*/
_differenceTree = _differenceTree =
path: lhs: rhs: path: lhs: rhs:
# If the lhs doesn't have any files, or the right hand side includes all files # If the lhs doesn't have any files, or the right hand side includes all files
@@ -880,13 +998,20 @@ rec {
_directoryEntries path lhs _directoryEntries path lhs
); );
# Filters all files in a path based on a predicate /**
# Type: ({ name, type, ... } -> Bool) -> Path -> FileSet Filters all files in a path based on a predicate
# Type
```
_fileFilter :: ({ name :: String; type :: String; hasExt :: String -> Bool; ... } -> Bool) -> Path -> FileSet
```
*/
_fileFilter = _fileFilter =
predicate: root: predicate: root:
let let
# Check the predicate for a single file # Check the predicate for a single file
# Type: String -> String -> filesetTree # Type: String -> String -> FileSetTree
fromFile = fromFile =
name: type: name: type:
if if
@@ -905,7 +1030,7 @@ rec {
null; null;
# Check the predicate for all files in a directory # Check the predicate for all files in a directory
# Type: Path -> filesetTree # Type: Path -> FileSetTree
fromDir = fromDir =
path: path:
mapAttrs ( mapAttrs (
@@ -922,12 +1047,18 @@ rec {
${baseNameOf root} = fromFile (baseNameOf root) rootType; ${baseNameOf root} = fromFile (baseNameOf root) rootType;
}; };
# Mirrors the contents of a Nix store path relative to a local path as a file set. /**
# Some notes: Mirrors the contents of a Nix store path relative to a local path as a file set.
# - The store path is read at evaluation time. Some notes:
# - The store path must not include files that don't exist in the respective local path. - The store path is read at evaluation time.
# - The store path must not include files that don't exist in the respective local path.
# Type: Path -> String -> FileSet
# Type
```
_mirrorStorePath :: Path -> String -> FileSet
```
*/
_mirrorStorePath = _mirrorStorePath =
localPath: storePath: localPath: storePath:
let let
@@ -939,8 +1070,15 @@ rec {
in in
_create localPath (recurse storePath); _create localPath (recurse storePath);
# Create a file set from the files included in the result of a fetchGit call /**
# Type: String -> String -> Path -> Attrs -> FileSet Create a file set from the files included in the result of a fetchGit call
# Type
```
_fromFetchGit :: String -> String -> Path -> AttrSet -> FileSet
```
*/
_fromFetchGit = _fromFetchGit =
function: argument: path: extraFetchGitAttrs: function: argument: path: extraFetchGitAttrs:
let let

View File

@@ -152,7 +152,7 @@ in
# Type # Type
``` ```
Path -> Map String Path haskellPathsInDir :: Path -> { [String] :: Path }
``` ```
*/ */
haskellPathsInDir = haskellPathsInDir =
@@ -189,7 +189,7 @@ in
# Type # Type
``` ```
RegExp -> Path -> Nullable { path : Path; matches : [ MatchResults ]; } locateDominatingFile :: RegExp -> Path -> ({ path :: Path; matches :: [MatchResults]; } | Null)
``` ```
*/ */
locateDominatingFile = locateDominatingFile =
@@ -229,7 +229,7 @@ in
# Type # Type
``` ```
Path -> [ Path ] listFilesRecursive :: Path -> [Path]
``` ```
*/ */
listFilesRecursive = listFilesRecursive =
@@ -320,9 +320,9 @@ in
``` ```
packagesFromDirectoryRecursive :: { packagesFromDirectoryRecursive :: {
callPackage :: Path -> {} -> a, callPackage :: Path -> AttrSet -> Any;
newScope? :: AttrSet -> scope, newScope? :: AttrSet -> Scope;
directory :: Path, directory :: Path;
} -> AttrSet } -> AttrSet
``` ```

View File

@@ -146,7 +146,7 @@ rec {
# Type # Type
``` ```
(a -> a) -> a -> a converge :: (a -> a) -> a -> a
``` ```
*/ */
converge = converge =
@@ -295,9 +295,9 @@ rec {
# Type # Type
``` ```
extends :: (Attrs -> Attrs -> Attrs) # The overlay to apply to the fixed-point function extends :: (AttrSet -> AttrSet -> AttrSet) # The overlay to apply to the fixed-point function
-> (Attrs -> Attrs) # A fixed-point function -> (AttrSet -> AttrSet) # A fixed-point function
-> (Attrs -> Attrs) # The resulting fixed-point function -> (AttrSet -> AttrSet) # The resulting fixed-point function
``` ```
# Examples # Examples
@@ -376,7 +376,7 @@ rec {
# #
OverlayFn = { ... } -> { ... } -> { ... }; OverlayFn = { ... } -> { ... } -> { ... };
in in
composeManyExtensions :: ListOf OverlayFn -> OverlayFn composeManyExtensions :: [OverlayFn] -> OverlayFn
``` ```
# Examples # Examples
@@ -480,14 +480,11 @@ rec {
# Type # Type
``` ```
toExtension :: toExtension :: b' -> Any -> Any -> b'
b' -> Any -> Any -> b'
or or
toExtension :: toExtension :: (a -> b') -> Any -> a -> b'
(a -> b') -> Any -> a -> b'
or or
toExtension :: toExtension :: (a -> a -> b) -> a -> a -> b
(a -> a -> b) -> a -> a -> b
where b' = ! Callable where b' = ! Callable
Set a = b = b' = AttrSet & ! Callable to make toExtension return an extending function. Set a = b = b' = AttrSet & ! Callable to make toExtension return an extending function.

View File

@@ -778,7 +778,7 @@ rec {
# Type # Type
``` ```
toLua :: AttrSet -> Any -> String toLua :: { multiline :: Bool; indent :: String; asBindings :: Bool; } -> Any -> String
``` ```
# Examples # Examples
@@ -879,7 +879,7 @@ rec {
# Type # Type
``` ```
mkLuaInline :: String -> AttrSet mkLuaInline :: String -> { _type = "lua-inline"; expr :: String; }
``` ```
*/ */
mkLuaInline = expr: { mkLuaInline = expr: {

View File

@@ -128,7 +128,7 @@ rec {
# Type # Type
``` ```
mkValue :: Any -> gvariant mkValue :: Any -> GVariant
``` ```
*/ */
mkValue = mkValue =
@@ -174,7 +174,7 @@ rec {
# Type # Type
``` ```
mkArray :: [Any] -> gvariant mkArray :: [Any] -> GVariant
``` ```
# Examples # Examples
@@ -213,7 +213,7 @@ rec {
# Type # Type
``` ```
mkEmptyArray :: gvariant.type -> gvariant mkEmptyArray :: GVariantType -> GVariant
``` ```
# Examples # Examples
@@ -247,7 +247,7 @@ rec {
# Type # Type
``` ```
mkVariant :: Any -> gvariant mkVariant :: Any -> GVariant
``` ```
# Examples # Examples
@@ -289,7 +289,7 @@ rec {
# Type # Type
``` ```
mkDictionaryEntry :: String -> Any -> gvariant mkDictionaryEntry :: String -> Any -> GVariant
``` ```
# Examples # Examples
@@ -335,7 +335,7 @@ rec {
# Type # Type
``` ```
mkMaybe :: gvariant.type -> Any -> gvariant mkMaybe :: GVariantType -> Any -> GVariant
``` ```
*/ */
mkMaybe = mkMaybe =
@@ -358,7 +358,7 @@ rec {
# Type # Type
``` ```
mkNothing :: gvariant.type -> gvariant mkNothing :: GVariantType -> GVariant
``` ```
*/ */
mkNothing = elemType: mkMaybe elemType null; mkNothing = elemType: mkMaybe elemType null;
@@ -375,7 +375,7 @@ rec {
# Type # Type
``` ```
mkJust :: Any -> gvariant mkJust :: Any -> GVariant
``` ```
*/ */
mkJust = mkJust =
@@ -397,7 +397,7 @@ rec {
# Type # Type
``` ```
mkTuple :: [Any] -> gvariant mkTuple :: [Any] -> GVariant
``` ```
*/ */
mkTuple = mkTuple =
@@ -423,7 +423,7 @@ rec {
# Type # Type
``` ```
mkBoolean :: Bool -> gvariant mkBoolean :: Bool -> GVariant
``` ```
*/ */
mkBoolean = mkBoolean =
@@ -445,7 +445,7 @@ rec {
# Type # Type
``` ```
mkString :: String -> gvariant mkString :: String -> GVariant
``` ```
*/ */
mkString = mkString =
@@ -470,7 +470,7 @@ rec {
# Type # Type
``` ```
mkObjectpath :: String -> gvariant mkObjectpath :: String -> GVariant
``` ```
*/ */
mkObjectpath = mkObjectpath =
@@ -486,7 +486,7 @@ rec {
# Type # Type
``` ```
mkUchar :: Int -> gvariant mkUchar :: Int -> GVariant
``` ```
*/ */
mkUchar = mkPrimitive type.uchar; mkUchar = mkPrimitive type.uchar;
@@ -497,7 +497,7 @@ rec {
# Type # Type
``` ```
mkInt16 :: Int -> gvariant mkInt16 :: Int -> GVariant
``` ```
*/ */
mkInt16 = mkPrimitive type.int16; mkInt16 = mkPrimitive type.int16;
@@ -508,7 +508,7 @@ rec {
# Type # Type
``` ```
mkUint16 :: Int -> gvariant mkUint16 :: Int -> GVariant
``` ```
*/ */
mkUint16 = mkPrimitive type.uint16; mkUint16 = mkPrimitive type.uint16;
@@ -525,7 +525,7 @@ rec {
# Type # Type
``` ```
mkInt32 :: Int -> gvariant mkInt32 :: Int -> GVariant
``` ```
*/ */
mkInt32 = mkInt32 =
@@ -541,7 +541,7 @@ rec {
# Type # Type
``` ```
mkUint32 :: Int -> gvariant mkUint32 :: Int -> GVariant
``` ```
*/ */
mkUint32 = mkPrimitive type.uint32; mkUint32 = mkPrimitive type.uint32;
@@ -552,7 +552,7 @@ rec {
# Type # Type
``` ```
mkInt64 :: Int -> gvariant mkInt64 :: Int -> GVariant
``` ```
*/ */
mkInt64 = mkPrimitive type.int64; mkInt64 = mkPrimitive type.int64;
@@ -563,7 +563,7 @@ rec {
# Type # Type
``` ```
mkUint64 :: Int -> gvariant mkUint64 :: Int -> GVariant
``` ```
*/ */
mkUint64 = mkPrimitive type.uint64; mkUint64 = mkPrimitive type.uint64;
@@ -580,7 +580,7 @@ rec {
# Type # Type
``` ```
mkDouble :: Float -> gvariant mkDouble :: Float -> GVariant
``` ```
*/ */
mkDouble = mkDouble =

View File

@@ -261,7 +261,7 @@ rec {
# Type # Type
``` ```
foldl' :: (acc -> x -> acc) -> acc -> [x] -> acc foldl' :: (a -> b -> a) -> a -> [b] -> a
``` ```
# Examples # Examples
@@ -298,7 +298,7 @@ rec {
# Type # Type
``` ```
imap0 :: (int -> a -> b) -> [a] -> [b] imap0 :: (Int -> a -> b) -> [a] -> [b]
``` ```
# Examples # Examples
@@ -330,7 +330,7 @@ rec {
# Type # Type
``` ```
imap1 :: (int -> a -> b) -> [a] -> [b] imap1 :: (Int -> a -> b) -> [a] -> [b]
``` ```
# Examples # Examples
@@ -372,7 +372,7 @@ rec {
# Type # Type
``` ```
ifilter0 :: (int -> a -> bool) -> [a] -> [a] ifilter0 :: (Int -> a -> Bool) -> [a] -> [a]
``` ```
# Examples # Examples
@@ -504,7 +504,7 @@ rec {
# Type # Type
``` ```
findSingle :: (a -> bool) -> a -> a -> [a] -> a findSingle :: (a -> Bool) -> a -> a -> [a] -> a
``` ```
# Examples # Examples
@@ -626,7 +626,7 @@ rec {
# Type # Type
``` ```
findFirst :: (a -> bool) -> a -> [a] -> a findFirst :: (a -> Bool) -> a -> [a] -> a
``` ```
# Examples # Examples
@@ -666,7 +666,7 @@ rec {
# Type # Type
``` ```
any :: (a -> bool) -> [a] -> bool any :: (a -> Bool) -> [a] -> Bool
``` ```
# Examples # Examples
@@ -701,7 +701,7 @@ rec {
# Type # Type
``` ```
all :: (a -> bool) -> [a] -> bool all :: (a -> Bool) -> [a] -> Bool
``` ```
# Examples # Examples
@@ -732,7 +732,7 @@ rec {
# Type # Type
``` ```
count :: (a -> bool) -> [a] -> int count :: (a -> Bool) -> [a] -> Int
``` ```
# Examples # Examples
@@ -766,7 +766,7 @@ rec {
# Type # Type
``` ```
optional :: bool -> a -> [a] optional :: Bool -> a -> [a]
``` ```
# Examples # Examples
@@ -800,7 +800,7 @@ rec {
# Type # Type
``` ```
optionals :: bool -> [a] -> [a] optionals :: Bool -> [a] -> [a]
``` ```
# Examples # Examples
@@ -866,7 +866,7 @@ rec {
# Type # Type
``` ```
range :: int -> int -> [int] range :: Int -> Int -> [Int]
``` ```
# Examples # Examples
@@ -900,7 +900,7 @@ rec {
# Type # Type
``` ```
replicate :: int -> a -> [a] replicate :: Int -> a -> [a]
``` ```
# Examples # Examples
@@ -935,7 +935,7 @@ rec {
# Type # Type
``` ```
(a -> bool) -> [a] -> { right :: [a]; wrong :: [a]; } partition :: (a -> Bool) -> [a] -> { right :: [a]; wrong :: [a]; }
``` ```
# Examples # Examples
@@ -977,7 +977,7 @@ rec {
# Type # Type
``` ```
groupBy' :: (b -> a -> b) -> b -> (a -> string) -> [a] -> Map string b groupBy' :: (a -> b -> a) -> a -> (b -> String) -> [b] -> { [String] :: a }
``` ```
# Examples # Examples
@@ -1149,7 +1149,7 @@ rec {
# Type # Type
``` ```
listDfs :: bool -> (a -> a -> bool) -> [a] -> attrs listDfs :: Bool -> (a -> a -> Bool) -> [a] -> ({ minimal :: a; visited :: [a]; rest :: [a]; } | { cycle :: a; loops :: [a]; visited :: [a]; rest :: [a]; })
``` ```
# Examples # Examples
@@ -1220,7 +1220,7 @@ rec {
# Type # Type
``` ```
toposort :: (a -> a -> bool) -> [a] -> attrs toposort :: (a -> a -> Bool) -> [a] -> ({ result :: [a]; } | { cycle :: [a]; loops :: [a]; })
``` ```
# Examples # Examples
@@ -1397,7 +1397,7 @@ rec {
# Type # Type
``` ```
compareLists :: (a -> a -> int) -> [a] -> [a] -> int compareLists :: (a -> a -> Int) -> [a] -> [a] -> Int
``` ```
# Examples # Examples
@@ -1442,7 +1442,7 @@ rec {
# Type # Type
``` ```
naturalSort :: [str] -> [str] naturalSort :: [String] -> [String]
``` ```
# Examples # Examples
@@ -1488,7 +1488,7 @@ rec {
# Type # Type
``` ```
take :: int -> [a] -> [a] take :: Int -> [a] -> [a]
``` ```
# Examples # Examples
@@ -1522,7 +1522,7 @@ rec {
# Type # Type
``` ```
takeEnd :: int -> [a] -> [a] takeEnd :: Int -> [a] -> [a]
``` ```
# Examples # Examples
@@ -1556,7 +1556,7 @@ rec {
# Type # Type
``` ```
drop :: int -> [a] -> [a] drop :: Int -> [a] -> [a]
``` ```
# Examples # Examples
@@ -1624,7 +1624,7 @@ rec {
# Type # Type
``` ```
hasPrefix :: [a] -> [a] -> bool hasPrefix :: [a] -> [a] -> Bool
``` ```
# Examples # Examples
@@ -1703,7 +1703,7 @@ rec {
# Type # Type
``` ```
sublist :: int -> int -> [a] -> [a] sublist :: Int -> Int -> [a] -> [a]
``` ```
# Examples # Examples
@@ -1921,7 +1921,7 @@ rec {
# Type # Type
``` ```
uniqueStrings :: [ String ] -> [ String ] uniqueStrings :: [String] -> [String]
``` ```
# Examples # Examples
@@ -1949,7 +1949,7 @@ rec {
# Type # Type
``` ```
allUnique :: [a] -> bool allUnique :: [a] -> Bool
``` ```
# Examples # Examples
@@ -2052,7 +2052,7 @@ rec {
# Type # Type
``` ```
mutuallyExclusive :: [a] -> [a] -> bool mutuallyExclusive :: [a] -> [a] -> Bool
``` ```
*/ */
mutuallyExclusive = a: b: length a == 0 || !(any (x: elem x a) b); mutuallyExclusive = a: b: length a == 0 || !(any (x: elem x a) b);
@@ -2070,7 +2070,7 @@ rec {
# Type # Type
``` ```
concatAttrValues :: (Map string a) -> [a] concatAttrValues :: { [String] :: [a] } -> [a]
``` ```
# Examples # Examples
@@ -2103,7 +2103,7 @@ rec {
# Type # Type
``` ```
replaceElemAt :: [a] -> int - b -> [a] replaceElemAt :: [a] -> Int -> a -> [a]
``` ```
# Examples # Examples

View File

@@ -42,7 +42,7 @@ rec {
# Type # Type
``` ```
addMetaAttrs :: attrs -> Derivation -> Derivation addMetaAttrs :: AttrSet -> Derivation -> Derivation
``` ```
# Examples # Examples
@@ -101,7 +101,7 @@ rec {
# Type # Type
``` ```
setName :: string -> Derivation -> Derivation setName :: String -> Derivation -> Derivation
``` ```
*/ */
setName = name: drv: drv // { inherit name; }; setName = name: drv: drv // { inherit name; };
@@ -122,7 +122,7 @@ rec {
# Type # Type
``` ```
updateName :: (string -> string) -> Derivation -> Derivation updateName :: (String -> String) -> Derivation -> Derivation
``` ```
# Examples # Examples
@@ -150,7 +150,7 @@ rec {
# Type # Type
``` ```
appendToName :: string -> Derivation -> Derivation appendToName :: String -> Derivation -> Derivation
``` ```
*/ */
appendToName = appendToName =
@@ -179,7 +179,7 @@ rec {
# Type # Type
``` ```
mapDerivationAttrset :: (Derivation -> a) -> attrs -> attrs mapDerivationAttrset :: (Derivation -> a) -> AttrSet -> AttrSet
``` ```
*/ */
mapDerivationAttrset = mapDerivationAttrset =
@@ -204,7 +204,7 @@ rec {
# Type # Type
``` ```
setPrio :: int -> Derivation -> Derivation setPrio :: Int -> Derivation -> Derivation
``` ```
*/ */
setPrio = priority: addMetaAttrs { inherit priority; }; setPrio = priority: addMetaAttrs { inherit priority; };
@@ -239,7 +239,7 @@ rec {
# Type # Type
``` ```
lowPrioSet :: (Map string Derivation) -> (Map string Derivation) lowPrioSet :: { [String] :: Derivation } -> { [String] :: Derivation }
``` ```
*/ */
lowPrioSet = set: mapDerivationAttrset lowPrio set; lowPrioSet = set: mapDerivationAttrset lowPrio set;
@@ -274,7 +274,7 @@ rec {
# Type # Type
``` ```
hiPrioSet :: (Map string Derivation) -> (Map string Derivation) hiPrioSet :: { [String] :: Derivation } -> { [String] :: Derivation }
``` ```
*/ */
hiPrioSet = set: mapDerivationAttrset hiPrio set; hiPrioSet = set: mapDerivationAttrset hiPrio set;
@@ -404,7 +404,15 @@ rec {
# Type # Type
``` ```
getLicenseFromSpdxId :: str -> AttrSet getLicenseFromSpdxId :: String -> {
deprecated :: Bool;
free :: Bool;
fullName :: String;
redistributable :: Bool;
shortName :: String;
spdxId :: String;
url :: String;
}
``` ```
# Examples # Examples
@@ -449,7 +457,15 @@ rec {
# Type # Type
``` ```
getLicenseFromSpdxIdOr :: str -> Any -> Any getLicenseFromSpdxIdOr :: String -> a -> ({
deprecated :: Bool;
free :: Bool;
fullName :: String;
redistributable :: Bool;
shortName :: String;
spdxId :: String;
url :: String;
} | a)
``` ```
# Examples # Examples
@@ -491,7 +507,7 @@ rec {
# Type # Type
``` ```
getExe :: package -> string getExe :: Derivation -> StorePath
``` ```
# Examples # Examples
@@ -537,7 +553,7 @@ rec {
# Type # Type
``` ```
getExe' :: derivation -> string -> string getExe' :: Derivation -> String -> StorePath
``` ```
# Examples # Examples
@@ -579,7 +595,7 @@ rec {
# Type # Type
``` ```
cpeFullVersionWithVendor :: string -> string -> AttrSet cpeFullVersionWithVendor :: String -> String -> { update :: String; vendor :: String; version :: String; }
``` ```
# Examples # Examples
@@ -634,7 +650,7 @@ rec {
# Type # Type
``` ```
tryCPEPatchVersionInUpdateWithVendor :: string -> string -> AttrSet tryCPEPatchVersionInUpdateWithVendor :: String -> String -> ({ success = true; value :: { update :: String; vendor :: String; version :: String; }; } | { success = false; error :: String; })
``` ```
# Examples # Examples
@@ -705,7 +721,7 @@ rec {
# Type # Type
``` ```
cpePatchVersionInUpdateWithVendor :: string -> string -> AttrSet cpePatchVersionInUpdateWithVendor :: String -> String -> { update :: String; vendor :: String; version :: String; }
``` ```
# Examples # Examples

View File

@@ -1461,7 +1461,7 @@ let
# Type # Type
``` ```
option -> attrsOf { highestPrio, value } mergeAttrDefinitionsWithPrio :: Option -> { [String] :: { highestPrio :: Int; value :: Any; } }
``` ```
*/ */
mergeAttrDefinitionsWithPrio = mergeAttrDefinitionsWithPrio =

View File

@@ -33,7 +33,7 @@ let
the list of strings which then can be parsed using `_parseExpanded`. the list of strings which then can be parsed using `_parseExpanded`.
Throws an error when the address is malformed. Throws an error when the address is malformed.
# Type: String -> [ String ] # Type: String -> [String]
# Example: # Example:
@@ -94,7 +94,7 @@ let
functions. functions.
Throws an error some element is not an u16 integer. Throws an error some element is not an u16 integer.
# Type: [ String ] -> IPv6 # Type: [String] -> IPv6
# Example: # Example:
@@ -168,7 +168,7 @@ in
prefix length are validated and converted to an internal representation prefix length are validated and converted to an internal representation
that can be used by other functions. that can be used by other functions.
# Type: String -> [ {address :: IPv6, prefixLength :: Int} ] # Type: String -> [{ address :: IPv6; prefixLength :: Int; }]
# Example: # Example:

View File

@@ -71,7 +71,7 @@ rec {
# Type # Type
``` ```
isOption :: a -> Bool isOption :: Any -> Bool
``` ```
*/ */
isOption = lib.isType "option"; isOption = lib.isType "option";
@@ -258,7 +258,7 @@ rec {
# Type # Type
``` ```
mkPackageOption :: pkgs -> (string|[string]) -> { nullable? :: bool, default? :: string|[string], example? :: null|string|[string], extraDescription? :: string, pkgsText? :: string } -> option mkPackageOption :: Pkgs -> (String | [String]) -> { nullable? :: Bool; default? :: String | [String]; example? :: Null | String | [String]; extraDescription? :: String; pkgsText? :: String; } -> Option
``` ```
# Examples # Examples
@@ -525,7 +525,7 @@ rec {
# Type # Type
``` ```
getValues :: [ { value :: a; } ] -> [a] getValues :: [{ value :: a; ... }] -> [a]
``` ```
# Examples # Examples
@@ -547,7 +547,7 @@ rec {
# Type # Type
``` ```
getFiles :: [ { file :: a; } ] -> [a] getFiles :: [{ file :: a; ... }] -> [a]
``` ```
# Examples # Examples
@@ -885,7 +885,7 @@ rec {
# Type # Type
``` ```
showDefsSep :: { files :: [ String ]; loc :: [ String ]; ... } -> string showOptionWithDefLocs :: { files :: [String]; loc :: [String]; ... } -> String
``` ```
*/ */
showOptionWithDefLocs = opt: '' showOptionWithDefLocs = opt: ''

View File

@@ -115,7 +115,7 @@ let
# An empty string is not a valid relative path, so we need to return a `.` when we have no components # An empty string is not a valid relative path, so we need to return a `.` when we have no components
(if components == [ ] then "." else concatStringsSep "/" components); (if components == [ ] then "." else concatStringsSep "/" components);
# Type: Path -> { root :: Path, components :: [ String ] } # Type: Path -> { root :: Path; components :: [String]; }
# #
# Deconstruct a path value type into: # Deconstruct a path value type into:
# - root: The filesystem root of the path, generally `/` # - root: The filesystem root of the path, generally `/`
@@ -143,7 +143,7 @@ let
# The number of store directory components, typically 2 # The number of store directory components, typically 2
storeDirLength = length storeDirComponents; storeDirLength = length storeDirComponents;
# Type: [ String ] -> Bool # Type: [String] -> Bool
# #
# Whether path components have a store path as a prefix, according to # Whether path components have a store path as a prefix, according to
# https://nixos.org/manual/nix/stable/store/store-path.html#store-path. # https://nixos.org/manual/nix/stable/store/store-path.html#store-path.
@@ -395,7 +395,7 @@ in
# Type # Type
``` ```
splitRoot :: Path -> { root :: Path, subpath :: String } splitRoot :: Path -> { root :: Path; subpath :: String; }
``` ```
# Examples # Examples
@@ -607,7 +607,7 @@ in
# Type # Type
``` ```
subpath.join :: [ String ] -> String subpath.join :: [String] -> String
``` ```
# Examples # Examples
@@ -679,7 +679,7 @@ in
# Type # Type
``` ```
subpath.components :: String -> [ String ] subpath.components :: String -> [String]
``` ```
# Examples # Examples

View File

@@ -131,7 +131,7 @@ let
# that src.filter is called lazily. # that src.filter is called lazily.
# For implementing a filter, see # For implementing a filter, see
# https://nixos.org/nix/manual/#builtin-filterSource # https://nixos.org/nix/manual/#builtin-filterSource
# Type: A function (path -> type -> bool) # Type: A function (Path -> Type -> Bool)
filter ? _path: _type: true, filter ? _path: _type: true,
# Optional name to use as part of the store path. # Optional name to use as part of the store path.
# This defaults to `src.name` or otherwise `"source"`. # This defaults to `src.name` or otherwise `"source"`.
@@ -158,7 +158,7 @@ let
# Type # Type
``` ```
sources.trace :: sourceLike -> Source sources.trace :: SourceLike -> Source
``` ```
*/ */
trace = trace =
@@ -241,7 +241,7 @@ let
# Type # Type
``` ```
sourceLike -> [String] -> Source sourceFilesBySuffices :: SourceLike -> [String] -> Source
``` ```
# Examples # Examples

View File

@@ -77,7 +77,7 @@ rec {
# Type # Type
``` ```
textClosureList :: { ${phase} :: { deps :: [String]; text :: String; } | String; } -> [String] -> [String] textClosureList :: { [String] :: { deps :: [String]; text :: String; } | String; } -> [String] -> [String]
``` ```
# Examples # Examples

View File

@@ -56,7 +56,7 @@ rec {
# Type # Type
``` ```
join :: string -> [ string ] -> string join :: String -> [String] -> String
``` ```
# Examples # Examples
@@ -78,7 +78,7 @@ rec {
# Type # Type
``` ```
concatStrings :: [string] -> string concatStrings :: [String] -> String
``` ```
# Examples # Examples
@@ -108,7 +108,7 @@ rec {
# Type # Type
``` ```
concatMapStrings :: (a -> string) -> [a] -> string concatMapStrings :: (a -> String) -> [a] -> String
``` ```
# Examples # Examples
@@ -139,7 +139,7 @@ rec {
# Type # Type
``` ```
concatImapStrings :: (int -> a -> string) -> [a] -> string concatImapStrings :: (Int -> a -> String) -> [a] -> String
``` ```
# Examples # Examples
@@ -209,7 +209,7 @@ rec {
# Type # Type
``` ```
concatStringsSep :: string -> [string] -> string concatStringsSep :: String -> [String] -> String
``` ```
# Examples # Examples
@@ -244,7 +244,7 @@ rec {
# Type # Type
``` ```
concatMapStringsSep :: string -> (a -> string) -> [a] -> string concatMapStringsSep :: String -> (a -> String) -> [a] -> String
``` ```
# Examples # Examples
@@ -280,7 +280,7 @@ rec {
# Type # Type
``` ```
concatIMapStringsSep :: string -> (int -> a -> string) -> [a] -> string concatIMapStringsSep :: String -> (Int -> a -> String) -> [a] -> String
``` ```
# Examples # Examples
@@ -316,7 +316,7 @@ rec {
# Type # Type
``` ```
concatMapAttrsStringSep :: String -> (String -> Any -> String) -> AttrSet -> String concatMapAttrsStringSep :: String -> (String -> a -> String) -> { [String] :: a } -> String
``` ```
# Examples # Examples
@@ -347,7 +347,7 @@ rec {
# Type # Type
``` ```
concatLines :: [string] -> string concatLines :: [String] -> String
``` ```
# Examples # Examples
@@ -380,7 +380,7 @@ rec {
# Type # Type
``` ```
replaceString :: string -> string -> string -> string replaceString :: String -> String -> String -> String
``` ```
# Examples # Examples
@@ -413,7 +413,7 @@ rec {
# Type # Type
``` ```
replicate :: int -> string -> string replicate :: Int -> String -> String
``` ```
# Examples # Examples
@@ -445,7 +445,7 @@ rec {
# Type # Type
``` ```
trim :: string -> string trim :: String -> String
``` ```
# Examples # Examples
@@ -487,7 +487,7 @@ rec {
# Type # Type
``` ```
trimWith :: { start :: Bool; end :: Bool } -> String -> String trimWith :: { start :: Bool; end :: Bool; } -> String -> String
``` ```
# Examples # Examples
@@ -548,7 +548,7 @@ rec {
# Type # Type
``` ```
makeSearchPath :: string -> [string] -> string makeSearchPath :: String -> [String] -> String
``` ```
# Examples # Examples
@@ -588,7 +588,7 @@ rec {
# Type # Type
``` ```
makeSearchPathOutput :: string -> string -> [package] -> string makeSearchPathOutput :: String -> String -> [Derivation] -> String
``` ```
# Examples # Examples
@@ -618,7 +618,7 @@ rec {
# Type # Type
``` ```
makeLibraryPath :: [package] -> string makeLibraryPath :: [Derivation] -> String
``` ```
# Examples # Examples
@@ -649,7 +649,7 @@ rec {
# Type # Type
``` ```
makeIncludePath :: [package] -> string makeIncludePath :: [Derivation] -> String
``` ```
# Examples # Examples
@@ -680,7 +680,7 @@ rec {
# Type # Type
``` ```
makeBinPath :: [package] -> string makeBinPath :: [Derivation] -> String
``` ```
# Examples # Examples
@@ -707,7 +707,7 @@ rec {
# Type # Type
``` ```
normalizePath :: string -> string normalizePath :: String -> String
``` ```
# Examples # Examples
@@ -748,7 +748,7 @@ rec {
# Type # Type
``` ```
optionalString :: bool -> string -> string optionalString :: Bool -> String -> String
``` ```
# Examples # Examples
@@ -780,7 +780,7 @@ rec {
# Type # Type
``` ```
hasPrefix :: string -> string -> bool hasPrefix :: String -> String -> Bool
``` ```
# Examples # Examples
@@ -823,7 +823,7 @@ rec {
# Type # Type
``` ```
hasSuffix :: string -> string -> bool hasSuffix :: String -> String -> Bool
``` ```
# Examples # Examples
@@ -869,7 +869,7 @@ rec {
# Type # Type
``` ```
hasInfix :: string -> string -> bool hasInfix :: String -> String -> Bool
``` ```
# Examples # Examples
@@ -918,7 +918,7 @@ rec {
# Type # Type
``` ```
stringToCharacters :: string -> [string] stringToCharacters :: String -> [String]
``` ```
# Examples # Examples
@@ -953,7 +953,7 @@ rec {
# Type # Type
``` ```
stringAsChars :: (string -> string) -> string -> string stringAsChars :: (String -> String) -> String -> String
``` ```
# Examples # Examples
@@ -985,7 +985,7 @@ rec {
# Type # Type
``` ```
charToInt :: string -> int charToInt :: String -> Int
``` ```
# Examples # Examples
@@ -1018,7 +1018,7 @@ rec {
# Type # Type
``` ```
escape :: [string] -> string -> string escape :: [String] -> String -> String
``` ```
# Examples # Examples
@@ -1050,7 +1050,7 @@ rec {
# Type # Type
``` ```
escapeC = [string] -> string -> string escapeC :: [String] -> String -> String
``` ```
# Examples # Examples
@@ -1082,7 +1082,7 @@ rec {
# Type # Type
``` ```
escapeURL :: string -> string escapeURL :: String -> String
``` ```
# Examples # Examples
@@ -1184,7 +1184,7 @@ rec {
# Type # Type
``` ```
escapeShellArg :: string -> string escapeShellArg :: String -> String
``` ```
# Examples # Examples
@@ -1220,7 +1220,7 @@ rec {
# Type # Type
``` ```
escapeShellArgs :: [string] -> string escapeShellArgs :: [String] -> String
``` ```
# Examples # Examples
@@ -1247,7 +1247,7 @@ rec {
# Type # Type
``` ```
string -> bool isValidPosixName :: String -> Bool
``` ```
# Examples # Examples
@@ -1287,7 +1287,7 @@ rec {
# Type # Type
``` ```
string -> ( string | [string] | { ${name} :: string; } ) -> string toShellVar :: String -> (String | [String] | { [String] :: String }) -> String
``` ```
# Examples # Examples
@@ -1329,8 +1329,8 @@ rec {
``` ```
toShellVars :: { toShellVars :: {
${name} :: string | [ string ] | { ${key} :: string; }; [String] :: String | [String] | { [String] :: String };
} -> string } -> String
``` ```
# Examples # Examples
@@ -1362,7 +1362,7 @@ rec {
# Type # Type
``` ```
escapeNixString :: string -> string escapeNixString :: String -> String
``` ```
# Examples # Examples
@@ -1389,7 +1389,7 @@ rec {
# Type # Type
``` ```
escapeRegex :: string -> string escapeRegex :: String -> String
``` ```
# Examples # Examples
@@ -1416,7 +1416,7 @@ rec {
# Type # Type
``` ```
escapeNixIdentifier :: string -> string escapeNixIdentifier :: String -> String
``` ```
# Examples # Examples
@@ -1467,7 +1467,7 @@ rec {
# Type # Type
``` ```
escapeXML :: string -> string escapeXML :: String -> String
``` ```
# Examples # Examples
@@ -1501,7 +1501,7 @@ rec {
# Type # Type
``` ```
toLower :: string -> string toLower :: String -> String
``` ```
# Examples # Examples
@@ -1528,7 +1528,7 @@ rec {
# Type # Type
``` ```
toUpper :: string -> string toUpper :: String -> String
``` ```
# Examples # Examples
@@ -1555,7 +1555,7 @@ rec {
# Type # Type
``` ```
toSentenceCase :: string -> string toSentenceCase :: String -> String
``` ```
# Examples # Examples
@@ -1593,7 +1593,7 @@ rec {
# Type # Type
``` ```
toCamelCase :: string -> string toCamelCase :: String -> String
``` ```
# Examples # Examples
@@ -1664,7 +1664,7 @@ rec {
# Type # Type
``` ```
addContextFrom :: string -> string -> string addContextFrom :: String -> String -> String
``` ```
# Examples # Examples
@@ -1705,7 +1705,7 @@ rec {
# Type # Type
``` ```
splitString :: string -> string -> [string] splitString :: String -> String -> [String]
``` ```
# Examples # Examples
@@ -1759,7 +1759,7 @@ rec {
# Type # Type
``` ```
splitStringBy :: (string -> string -> bool) -> bool -> string -> [string] splitStringBy :: (String -> String -> Bool) -> Bool -> String -> [String]
``` ```
# Examples # Examples
@@ -1835,7 +1835,7 @@ rec {
# Type # Type
``` ```
removePrefix :: string -> string -> string removePrefix :: String -> String -> String
``` ```
# Examples # Examples
@@ -1886,7 +1886,7 @@ rec {
# Type # Type
``` ```
removeSuffix :: string -> string -> string removeSuffix :: String -> String -> String
``` ```
# Examples # Examples
@@ -2125,7 +2125,7 @@ rec {
# Type # Type
``` ```
cmakeOptionType :: string -> string -> string -> string cmakeOptionType :: String -> String -> String -> String
``` ```
# Examples # Examples
@@ -2171,7 +2171,7 @@ rec {
# Type # Type
``` ```
cmakeBool :: string -> bool -> string cmakeBool :: String -> Bool -> String
``` ```
# Examples # Examples
@@ -2207,7 +2207,7 @@ rec {
# Type # Type
``` ```
cmakeFeature :: string -> string -> string cmakeFeature :: String -> String -> String
``` ```
# Examples # Examples
@@ -2242,7 +2242,7 @@ rec {
# Type # Type
``` ```
mesonOption :: string -> string -> string mesonOption :: String -> String -> String
``` ```
# Examples # Examples
@@ -2277,7 +2277,7 @@ rec {
# Type # Type
``` ```
mesonBool :: string -> bool -> string mesonBool :: String -> Bool -> String
``` ```
# Examples # Examples
@@ -2314,7 +2314,7 @@ rec {
# Type # Type
``` ```
mesonEnable :: string -> bool -> string mesonEnable :: String -> Bool -> String
``` ```
# Examples # Examples
@@ -2351,7 +2351,7 @@ rec {
# Type # Type
``` ```
enableFeature :: bool -> string -> string enableFeature :: Bool -> String -> String
``` ```
# Examples # Examples
@@ -2391,7 +2391,7 @@ rec {
# Type # Type
``` ```
enableFeatureAs :: bool -> string -> string -> string enableFeatureAs :: Bool -> String -> String -> String
``` ```
# Examples # Examples
@@ -2426,7 +2426,7 @@ rec {
# Type # Type
``` ```
withFeature :: bool -> string -> string withFeature :: Bool -> String -> String
``` ```
# Examples # Examples
@@ -2465,7 +2465,7 @@ rec {
# Type # Type
``` ```
withFeatureAs :: bool -> string -> string -> string withFeatureAs :: Bool -> String -> String -> String
``` ```
# Examples # Examples
@@ -2506,7 +2506,7 @@ rec {
# Type # Type
``` ```
fixedWidthString :: int -> string -> string -> string fixedWidthString :: Int -> String -> String -> String
``` ```
# Examples # Examples
@@ -2544,7 +2544,7 @@ rec {
# Type # Type
``` ```
fixedWidthNumber :: int -> int -> string fixedWidthNumber :: Int -> Int -> String
``` ```
# Examples # Examples
@@ -2572,7 +2572,7 @@ rec {
# Type # Type
``` ```
floatToString :: float -> string floatToString :: Float -> String
``` ```
# Examples # Examples
@@ -2611,7 +2611,7 @@ rec {
# Type # Type
``` ```
isConvertibleWithToString :: a -> bool isConvertibleWithToString :: Any -> Bool
``` ```
*/ */
isConvertibleWithToString = isConvertibleWithToString =
@@ -2640,7 +2640,7 @@ rec {
# Type # Type
``` ```
isStringLike :: a -> bool isStringLike :: Any -> Bool
``` ```
*/ */
isStringLike = x: isString x || isPath x || x ? outPath || x ? __toString; isStringLike = x: isString x || isPath x || x ? outPath || x ? __toString;
@@ -2656,7 +2656,7 @@ rec {
# Type # Type
``` ```
isStorePath :: a -> bool isStorePath :: Any -> Bool
``` ```
# Examples # Examples
@@ -2707,7 +2707,7 @@ rec {
# Type # Type
``` ```
toInt :: string -> int toInt :: String -> Int
``` ```
# Examples # Examples
@@ -2777,7 +2777,7 @@ rec {
# Type # Type
``` ```
toIntBase10 :: string -> int toIntBase10 :: String -> Int
``` ```
# Examples # Examples
@@ -2848,7 +2848,7 @@ rec {
# Type # Type
``` ```
fileContents :: path -> string fileContents :: Path -> String
``` ```
# Examples # Examples
@@ -2939,7 +2939,7 @@ rec {
# Type # Type
``` ```
levenshtein :: string -> string -> int levenshtein :: String -> String -> Int
``` ```
# Examples # Examples
@@ -2991,7 +2991,7 @@ rec {
# Type # Type
``` ```
commonPrefixLength :: string -> string -> int commonPrefixLength :: String -> String -> Int
``` ```
*/ */
commonPrefixLength = commonPrefixLength =
@@ -3023,7 +3023,7 @@ rec {
# Type # Type
``` ```
commonSuffixLength :: string -> string -> int commonSuffixLength :: String -> String -> Int
``` ```
*/ */
commonSuffixLength = commonSuffixLength =
@@ -3060,7 +3060,7 @@ rec {
# Type # Type
``` ```
levenshteinAtMost :: int -> string -> string -> bool levenshteinAtMost :: Int -> String -> String -> Bool
``` ```
# Examples # Examples

View File

@@ -554,7 +554,7 @@ rec {
# Type # Type
``` ```
hasInferior :: string -> string -> bool hasInferior :: String -> String -> Bool
``` ```
# Examples # Examples
@@ -586,7 +586,7 @@ rec {
# Type # Type
``` ```
canExecute :: string -> string -> bool canExecute :: String -> String -> Bool
``` ```
# Examples # Examples

View File

@@ -111,7 +111,7 @@ in
# Type # Type
``` ```
pipe :: a -> [<functions>] -> <return type of last function> pipe :: a -> [(a -> b) (b -> c) ... (x -> y) (y -> z)] -> z
``` ```
# Examples # Examples
@@ -204,7 +204,7 @@ in
# Type # Type
``` ```
or :: bool -> bool -> bool or :: Bool -> Bool -> Bool
``` ```
*/ */
"or" = x: y: x || y; "or" = x: y: x || y;
@@ -225,7 +225,7 @@ in
# Type # Type
``` ```
and :: bool -> bool -> bool and :: Bool -> Bool -> Bool
``` ```
*/ */
and = x: y: x && y; and = x: y: x && y;
@@ -259,7 +259,7 @@ in
# Type # Type
``` ```
bitNot :: number -> number bitNot :: Number -> Number
``` ```
*/ */
bitNot = builtins.sub (-1); bitNot = builtins.sub (-1);
@@ -280,7 +280,7 @@ in
# Type # Type
``` ```
boolToString :: bool -> string boolToString :: Bool -> String
``` ```
*/ */
boolToString = b: if b then "true" else "false"; boolToString = b: if b then "true" else "false";
@@ -300,7 +300,7 @@ in
# Type # Type
``` ```
boolToYesNo :: bool -> string boolToYesNo :: Bool -> String
``` ```
*/ */
boolToYesNo = b: if b then "yes" else "no"; boolToYesNo = b: if b then "yes" else "no";
@@ -321,7 +321,7 @@ in
# Type # Type
``` ```
mergeAttrs :: attrs -> attrs -> attrs mergeAttrs :: AttrSet -> AttrSet -> AttrSet
``` ```
# Examples # Examples
@@ -391,7 +391,7 @@ in
# Type # Type
``` ```
defaultTo :: a -> Nullable b -> (a | b) defaultTo :: a -> (b | Null) -> (b | a)
``` ```
# Examples # Examples
@@ -427,7 +427,7 @@ in
# Type # Type
``` ```
mapNullable :: (a -> b) -> Nullable a -> Nullable b mapNullable :: (a -> b) -> (a | Null) -> (b | Null)
``` ```
# Examples # Examples
@@ -526,7 +526,7 @@ in
# Type # Type
``` ```
revisionWithDefault :: string -> string revisionWithDefault :: String -> String
``` ```
*/ */
revisionWithDefault = revisionWithDefault =
@@ -551,7 +551,7 @@ in
# Type # Type
``` ```
inNixShell :: bool inNixShell :: Bool
``` ```
*/ */
inNixShell = builtins.getEnv "IN_NIX_SHELL" != ""; inNixShell = builtins.getEnv "IN_NIX_SHELL" != "";
@@ -564,7 +564,7 @@ in
# Type # Type
``` ```
inPureEvalMode :: bool inPureEvalMode :: Bool
``` ```
*/ */
inPureEvalMode = !builtins ? currentSystem; inPureEvalMode = !builtins ? currentSystem;
@@ -587,7 +587,7 @@ in
# Type # Type
``` ```
min :: number -> number -> number min :: Number -> Number -> Number
``` ```
*/ */
min = x: y: if x < y then x else y; min = x: y: if x < y then x else y;
@@ -608,7 +608,7 @@ in
# Type # Type
``` ```
max :: number -> number -> number max :: Number -> Number -> Number
``` ```
*/ */
max = x: y: if x > y then x else y; max = x: y: if x > y then x else y;
@@ -629,7 +629,7 @@ in
# Type # Type
``` ```
mod :: int -> int -> int mod :: Int -> Int -> Int
``` ```
# Examples # Examples
@@ -669,7 +669,7 @@ in
# Type # Type
``` ```
compare :: a -> a -> int compare :: a -> a -> Int
``` ```
*/ */
compare = compare =
@@ -712,7 +712,7 @@ in
# Type # Type
``` ```
(a -> bool) -> (a -> a -> int) -> (a -> a -> int) -> (a -> a -> int) splitByAndCompare :: (a -> Bool) -> (a -> a -> Int) -> (a -> a -> Int) -> (a -> a -> Int)
``` ```
# Examples # Examples
@@ -786,7 +786,7 @@ in
# Type # Type
``` ```
importJSON :: path -> any importJSON :: Path -> Any
``` ```
*/ */
importJSON = path: builtins.fromJSON (builtins.readFile path); importJSON = path: builtins.fromJSON (builtins.readFile path);
@@ -833,7 +833,7 @@ in
# Type # Type
``` ```
importTOML :: path -> any importTOML :: Path -> Any
``` ```
*/ */
importTOML = path: fromTOML (builtins.readFile path); importTOML = path: fromTOML (builtins.readFile path);
@@ -859,7 +859,7 @@ in
# Type # Type
``` ```
String -> a -> a warn :: String -> a -> a
``` ```
*/ */
warn = warn =
@@ -906,7 +906,7 @@ in
# Type # Type
``` ```
Bool -> String -> a -> a warnIf :: Bool -> String -> a -> a
``` ```
*/ */
warnIf = cond: msg: if cond then warn msg else x: x; warnIf = cond: msg: if cond then warn msg else x: x;
@@ -933,7 +933,7 @@ in
# Type # Type
``` ```
Boolean -> String -> a -> a warnIfNot :: Bool -> String -> a -> a
``` ```
*/ */
warnIfNot = cond: msg: if cond then x: x else warn msg; warnIfNot = cond: msg: if cond then x: x else warn msg;
@@ -962,7 +962,7 @@ in
# Type # Type
``` ```
bool -> string -> a -> a throwIfNot :: Bool -> String -> a -> (a | Never)
``` ```
# Examples # Examples
@@ -995,7 +995,7 @@ in
# Type # Type
``` ```
bool -> string -> a -> a throwIf :: Bool -> String -> a -> (a | Never)
``` ```
*/ */
throwIf = cond: msg: if cond then throw msg else x: x; throwIf = cond: msg: if cond then throw msg else x: x;
@@ -1020,7 +1020,7 @@ in
# Type # Type
``` ```
String -> List ComparableVal -> List ComparableVal -> a -> a checkListOfEnum :: String -> [a] -> [a] -> ((b -> b) | Never)
``` ```
# Examples # Examples
@@ -1073,7 +1073,7 @@ in
# Type # Type
``` ```
setFunctionArgs : (a -> b) -> (Map String Bool) -> (a -> b) setFunctionArgs : (a -> b) -> { [String] :: Bool } -> (a -> b)
``` ```
*/ */
setFunctionArgs = f: args: { setFunctionArgs = f: args: {
@@ -1097,7 +1097,7 @@ in
# Type # Type
``` ```
functionArgs : (a -> b) -> Map String Bool functionArgs : (a -> b) -> { [String] :: Bool }
``` ```
*/ */
functionArgs = functionArgs =
@@ -1120,7 +1120,7 @@ in
# Type # Type
``` ```
isFunction : a -> bool isFunction : Any -> Bool
``` ```
*/ */
isFunction = f: builtins.isFunction f || (f ? __functor && isFunction (f.__functor f)); isFunction = f: builtins.isFunction f || (f ? __functor && isFunction (f.__functor f));
@@ -1247,7 +1247,7 @@ in
# Type # Type
``` ```
toHexString :: int -> string toHexString :: Int -> String
``` ```
# Examples # Examples
@@ -1294,7 +1294,7 @@ in
# Type # Type
``` ```
toBaseDigits :: int -> int -> [int] toBaseDigits :: Int -> Int -> [Int]
``` ```
# Examples # Examples

View File

@@ -11,7 +11,7 @@ rec {
# Type # Type
``` ```
splitVersion :: string -> [string] splitVersion :: String -> [String]
``` ```
# Examples # Examples
@@ -39,7 +39,7 @@ rec {
# Type # Type
``` ```
major :: string -> string major :: String -> String
``` ```
# Examples # Examples
@@ -67,7 +67,7 @@ rec {
# Type # Type
``` ```
minor :: string -> string minor :: String -> String
``` ```
# Examples # Examples
@@ -95,7 +95,7 @@ rec {
# Type # Type
``` ```
patch :: string -> string patch :: String -> String
``` ```
# Examples # Examples
@@ -124,7 +124,7 @@ rec {
# Type # Type
``` ```
mmajorMinor :: string -> string majorMinor :: String -> String
``` ```
# Examples # Examples
@@ -156,7 +156,7 @@ rec {
# Type # Type
``` ```
pad :: int -> string -> string pad :: Int -> String -> String
``` ```
# Examples # Examples

View File

@@ -31,7 +31,7 @@
# Type # Type
``` ```
compressDrv :: Derivation -> { formats :: [ String ]; compressors :: { ${fileExtension} :: String; } } -> Derivation compressDrv :: Derivation -> { formats :: [String]; compressors :: { ${fileExtension} :: String; } } -> Derivation
``` ```
# Examples # Examples

View File

@@ -23,7 +23,7 @@
: See compressDrv for details. : See compressDrv for details.
`extraFormats` ([ String ]) `extraFormats` ([String])
: Extra extensions to compress in addition to `formats`. : Extra extensions to compress in addition to `formats`.
@@ -34,7 +34,7 @@
# Type # Type
``` ```
compressDrvWeb :: Derivation -> { formats :: [ String ]; extraFormats :: [ String ]; compressors :: { ${fileExtension} :: String; } } -> Derivation compressDrvWeb :: Derivation -> { formats :: [String]; extraFormats :: [String]; compressors :: { ${fileExtension} :: String; } } -> Derivation
``` ```
# Examples # Examples

View File

@@ -13,7 +13,7 @@
}: }:
{ {
units, units,
# : AttrSet String (Either Path { path : Path, wanted-by : [ String ] }) # : { [String] :: Path | { path :: Path; wanted-by :: [String]; } }
# ^ A set whose names are unit names and values are # ^ A set whose names are unit names and values are
# either paths to the corresponding unit files or a set # either paths to the corresponding unit files or a set
# containing the path and the list of units this unit # containing the path and the list of units this unit

View File

@@ -31,7 +31,7 @@ rec {
: the [interpreter](https://en.wikipedia.org/wiki/Shebang_(Unix)) to use for the script. : the [interpreter](https://en.wikipedia.org/wiki/Shebang_(Unix)) to use for the script.
: `check` (String) : `check` (String)
: A command to check the script. For example, this could be a linting check. : A command to check the script. For example, this could be a linting check.
: `makeWrapperArgs` (Optional, [ String ], Default: []) : `makeWrapperArgs` (Optional, [String], Default: [])
: Arguments forwarded to (`makeWrapper`)[#fun-makeWrapper]. : Arguments forwarded to (`makeWrapper`)[#fun-makeWrapper].
`nameOrPath` (String) `nameOrPath` (String)
@@ -195,7 +195,7 @@ rec {
: `strip` (Boolean, Default: true) : `strip` (Boolean, Default: true)
: Whether to [strip](https://nixos.org/manual/nixpkgs/stable/#ssec-fixup-phase) the executable or not. : Whether to [strip](https://nixos.org/manual/nixpkgs/stable/#ssec-fixup-phase) the executable or not.
: `makeWrapperArgs` (Optional, [ String ], Default: []) : `makeWrapperArgs` (Optional, [String], Default: [])
: Arguments forwarded to (`makeWrapper`)[#fun-makeWrapper] : Arguments forwarded to (`makeWrapper`)[#fun-makeWrapper]
`nameOrPath` (String) `nameOrPath` (String)