Put NAtom as expression
Modulehnix-0.17.0Haskell2010
Nix.Expr.Shorthands
Shorthands for making Nix expressions.
Functions with an F suffix return a more general type (base functor F a) without the outer
Fix wrapper that creates a.
- 77 values
- Packagehnix-0.17.0
- Exports77
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceShorthands.hs
Basic expression builders
35 declarationsPut null.
Put boolean.
Put integer.
Put floating point number.
Put a regular (double-quoted) string.
Put an indented string.
Put a path. Use True if the path should be read from the environment, else use False.
Put a path expression which pulls from the NIX_PATH env variable.
Put a path which references a relative path.
Put a variable (symbol).
Put syntactic hole.
Put a binary operator. @since
Put an unary operator.
Logical negation: not.
Number negation: -.
Negation in the language works with integers and floating point. @since 0.15.0
Put a binary operator. @since 0.15.0
{ x }{ x, ... }s@{ x }s@{ x, ... }Args:
Maybe name:
Nothing -> {}
Just "s" -> s@{}key:expr pairs
Is variadic or not:
True -> {...}
False -> {}rec { .. }Put a non-recursive set.
{ .. }General set builder function.
Empty set.
Monoid. Use // operation (shorthand $//) to extend the set.
@since 0.15.0
Put a list.
Wrap in a let.
(Evaluate the second argument after introducing the bindings.)
Haskell | Nix |
|---|---|
|
|
Create a whith:
1st expr - what to bring into the scope.
2nd - expression that recieves the scope extention.
Haskell | Nix |
|---|---|
|
|
Create an assert:
1st expr - asserting itself, must return true.
2nd - main expression to evaluated after assertion.
Haskell | Nix |
|---|---|
|
|
Put:
if expr1
then expr2
else expr3Lambda function, analog of Haskell's \ x -> x:
Haskell | Nix |
|---|---|
|
|
General dot-reference with optional alternative if the key does not exist. @since 0.15.0
Base functor builders for basic expressions builders *sic
Unfixed mkNull.
Unfixed mkBool.
Unfixed mkInt.
Unfixed mkFloat.
Unfixed mkPath.
Unfixed mkEnvPath.
Unfixed mkRelPath.
Unfixed mkSym.
Unfixed mkSynHole.
Other
10 declarationsAn inherit clause with an expression to pull from.
Hask | Nix | pseudocode |
|---|---|---|
|
|
|
An inherit clause without an expression to pull from.
Hask | Nix | pseudocode |
|---|---|---|
|
|
|
Nix = (bind operator).
Shorthand for producing a binding of a name to an expression: Nix's =.
Append a list of bindings to a set or let expression. For example: adding `[a = 1, b = 2]` to `let c = 3; in 4` produces `let a = 1; b = 2; c = 3; in 4`.
Applies a transformation to the body of a Nix function.
A let statement with multiple assignments.
Wrapper for a single-variable let.
Make a non-recursive attribute set.
Make a recursive attribute set.
Nix binary operators
19 declarationsDot-reference into an attribute set: attrSet.k
Dot-reference into an attribute set with alternative if the key does not exist.
s.x or yFunction application (' ' in f x)
List concatenation: ++
Multiplication: *
Division: /
Addition: +
Subtraction: -
Extendoverride the left attr set, with the right one: @/@
Greater than: >
Greater than OR equal: >=
Less than OR equal: <=
Less than: <
Equality: ==
Inequality: !=
AND: &&
OR: ||
Logical implication: ->
Lambda function, analog of Haskell's \ x -> x:
Haskell | Nix |
|---|---|
|
|
Under deprecation
4 declarationsDeprecated: Please, use mkOp
Put an unary operator.
Deprecated: Please, use mkOp2
| Put a binary operator.
Deprecated: Please, use mkOp2
| Nix binary operator builder.
Deprecated: Please, use:
* mkParamSet is for closed sets;
* mkVariadicSet is for variadic;
* mkGeneralParamSet a general constructor.