Modulehnix-0.17.0Haskell2010
Nix.Expr.Types
The Nix expression type and supporting types.
Brief introduction of the Nix expression language.
This module is a beginning of a deep embedding (term) of a Nix language into Haskell. Brief on shallow & deep embedding.
(additiona info for dev): Big use of TemplateHaskell in the module requires proper (top-down) organization of declarations.
- 19 types
- 1 class
- 57 values
- Packagehnix-0.17.0
- Exports77
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceTypes.hs
Get the name out of the parameter (there might be none).
Helper for SourcePos -> NSourcePos coersion.
Helper for NSourcePos -> SourcePos coersion.
Antiquoted represents an expression that is either antiquoted (surrounded by ${...}) or plain (not antiquoted).
Constructors
Plain !vEscapedNewlineEscapedNewline corresponds to the special newline form
''\nin an indented string. It is equivalent to a single newline character:
''''\n'' ≡ "\n"Antiquoted !r
Instances33Eq2, Ord2, Read2, Show2, Hashable2, FromJSON2, …
Eq2 AntiquotedDefined in hnix-0.17.0 · Nix.Expr.TypesOrd2 AntiquotedDefined in hnix-0.17.0 · Nix.Expr.TypesRead2 AntiquotedDefined in hnix-0.17.0 · Nix.Expr.TypesShow2 AntiquotedDefined in hnix-0.17.0 · Nix.Expr.TypesHashable2 AntiquotedDefined in hnix-0.17.0 · Nix.Expr.TypesFromJSON2 AntiquotedDefined in hnix-0.17.0 · Nix.Expr.TypesToJSON2 AntiquotedDefined in hnix-0.17.0 · Nix.Expr.TypesGeneric1 (Antiquoted v)Defined in hnix-0.17.0 · Nix.Expr.TypesFunctor (Antiquoted v)Defined in hnix-0.17.0 · Nix.Expr.TypesFoldable (Antiquoted v)Defined in hnix-0.17.0 · Nix.Expr.TypesTraversable (Antiquoted v)Defined in hnix-0.17.0 · Nix.Expr.TypesEq v => Eq1 (Antiquoted v)Defined in hnix-0.17.0 · Nix.Expr.TypesOrd v => Ord1 (Antiquoted v)Defined in hnix-0.17.0 · Nix.Expr.TypesRead v => Read1 (Antiquoted v)Defined in hnix-0.17.0 · Nix.Expr.TypesShow v => Show1 (Antiquoted v)Defined in hnix-0.17.0 · Nix.Expr.TypesNFData v => NFData1 (Antiquoted v)Defined in hnix-0.17.0 · Nix.Expr.TypesHashable v => Hashable1 (Antiquoted v)Defined in hnix-0.17.0 · Nix.Expr.TypesFromJSON v => FromJSON1 (Antiquoted v)Defined in hnix-0.17.0 · Nix.Expr.TypesToJSON v => ToJSON1 (Antiquoted v)Defined in hnix-0.17.0 · Nix.Expr.Types(Eq v, Eq r) => Eq (Antiquoted v r)Defined in hnix-0.17.0 · Nix.Expr.Types(Data v, Data r) => Data (Antiquoted v r)Defined in hnix-0.17.0 · Nix.Expr.Types(Ord v, Ord r) => Ord (Antiquoted v r)Defined in hnix-0.17.0 · Nix.Expr.Types(Read v, Read r) => Read (Antiquoted v r)Defined in hnix-0.17.0 · Nix.Expr.Types(Show v, Show r) => Show (Antiquoted v r)Defined in hnix-0.17.0 · Nix.Expr.TypesGeneric (Antiquoted v r)Defined in hnix-0.17.0 · Nix.Expr.Types(NFData v, NFData r) => NFData (Antiquoted v r)Defined in hnix-0.17.0 · Nix.Expr.Types(Binary v, Binary r) => Binary (Antiquoted v r)Defined in hnix-0.17.0 · Nix.Expr.Types(Hashable v, Hashable r) => Hashable (Antiquoted v r)Defined in hnix-0.17.0 · Nix.Expr.Types(FromJSON r, FromJSON v) => FromJSON (Antiquoted v r)Defined in hnix-0.17.0 · Nix.Expr.Types(ToJSON r, ToJSON v) => ToJSON (Antiquoted v r)Defined in hnix-0.17.0 · Nix.Expr.Types(Serialise v, Serialise r) => Serialise (Antiquoted v r)Defined in hnix-0.17.0 · Nix.Expr.Typestype Rep (Antiquoted v r) = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"Antiquoted"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (C1 ('MetaCons"Plain"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 v)) :+: (C1 ('MetaCons"EscapedNewline"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Antiquoted"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r))))type Rep1 (Antiquoted v) = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"Antiquoted"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (C1 ('MetaCons"Plain"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 v)) :+: (C1 ('MetaCons"EscapedNewline"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Antiquoted"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1)))
Hashmap VarName -- type synonymA single line of the bindings section of a let expression or of a set.
Constructors
NamedVar !(NAttrPath r) !r !NSourcePosAn explicit naming.
NamedVar (StaticKey "x" :| [StaticKey "y"]) z NSourcePos{} ~ x.y = z;Inherit !(Maybe r) ![VarName] !NSourcePosInheriting an attribute (binding) into the attribute set from the other scope (attribute set). No denoted scope means to inherit from the closest outside scope.
Hask
Nix
pseudocode
Inherit Nothing [StaticKey "a"] NSourcePos{}inherit a;a = outside.a;Inherit (pure x) [StaticKey "a"] NSourcePos{}inherit (x) a;a = x.a;Inherit (pure x) [StaticKey "a", StaticKey "b"] NSourcePos{}inherit (x) a b;a = x.a;b = x.b;(2021-07-07 use details): Inherits the position of the first name through
unsafeGetAttrPos. The position of the scope inherited from else - the position of the first member of the binds list.
Instances22Functor, Foldable, Traversable, Eq1, Ord1, Show1, …
Functor BindingDefined in hnix-0.17.0 · Nix.Expr.TypesFoldable BindingDefined in hnix-0.17.0 · Nix.Expr.TypesTraversable BindingDefined in hnix-0.17.0 · Nix.Expr.TypesEq1 BindingDefined in hnix-0.17.0 · Nix.Expr.TypesOrd1 BindingDefined in hnix-0.17.0 · Nix.Expr.TypesShow1 BindingDefined in hnix-0.17.0 · Nix.Expr.TypesNFData1 BindingDefined in hnix-0.17.0 · Nix.Expr.TypesHashable1 BindingDefined in hnix-0.17.0 · Nix.Expr.TypesGeneric1 BindingDefined in hnix-0.17.0 · Nix.Expr.TypesEq r => Eq (Binding r)Defined in hnix-0.17.0 · Nix.Expr.TypesData r => Data (Binding r)Defined in hnix-0.17.0 · Nix.Expr.TypesOrd r => Ord (Binding r)Defined in hnix-0.17.0 · Nix.Expr.TypesShow r => Show (Binding r)Defined in hnix-0.17.0 · Nix.Expr.TypesGeneric (Binding r)Defined in hnix-0.17.0 · Nix.Expr.TypesNFData r => NFData (Binding r)Defined in hnix-0.17.0 · Nix.Expr.TypesBinary r => Binary (Binding r)Defined in hnix-0.17.0 · Nix.Expr.TypesHashable r => Hashable (Binding r)Defined in hnix-0.17.0 · Nix.Expr.TypesFromJSON r => FromJSON (Binding r)Defined in hnix-0.17.0 · Nix.Expr.TypesToJSON r => ToJSON (Binding r)Defined in hnix-0.17.0 · Nix.Expr.TypesSerialise r => Serialise (Binding r)Defined in hnix-0.17.0 · Nix.Expr.Typestype Rep (Binding r) = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"Binding"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (C1 ('MetaCons"NamedVar"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NAttrPath r)) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NSourcePos))) :+: C1 ('MetaCons"Inherit"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe r)) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [VarName]) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NSourcePos))))type Rep1 Binding = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"Binding"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (C1 ('MetaCons"NamedVar"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (NonEmpty :.: Rec1 NKeyName) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NSourcePos))) :+: C1 ('MetaCons"Inherit"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec1 Maybe) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [VarName]) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NSourcePos))))
A selector (for example in a let or an attribute set) is made up
of strung-together key names.
StaticKey "x" :| [DynamicKey (Antiquoted y)] ~ x.${y}Binary operators expressible in the nix language.
Constructors
NEqEquality (
==)NNEqInequality (
!=)NLtLess than (
<)NLteLess than or equal (
<=)NGtGreater than (
>)NGteGreater than or equal (
>=)NAndLogical and (
&&)NOrLogical or (
||)NImplLogical implication (
->)NUpdateGet the left attr set, extend it with the right one & override equal keys (
//)NPlusAddition (
+)NMinusSubtraction (
-)NMultMultiplication (
*)NDivDivision (
/)NConcatList concatenation (
++)
Instances16Bounded, Enum, Eq, Data, Ord, Read, …
Bounded NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesEnum NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesEq NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesData NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesOrd NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesRead NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesShow NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesGeneric NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesNFData NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesBinary NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesHashable NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesFromJSON NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesToJSON NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesSerialise NBinaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesNOp NBinaryOpDefined in hnix-0.17.0 · Nix.Parsertype Rep NBinaryOp = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"NBinaryOp"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (((C1 ('MetaCons"NEq"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"NNEq"
'PrefixI 'False) U1 :+: C1 ('MetaCons"NLt"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"NLte"
'PrefixI 'False) U1 :+: C1 ('MetaCons"NGt"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"NGte"
'PrefixI 'False) U1 :+: C1 ('MetaCons"NAnd"
'PrefixI 'False) U1))) :+: (((C1 ('MetaCons"NOr"
'PrefixI 'False) U1 :+: C1 ('MetaCons"NImpl"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"NUpdate"
'PrefixI 'False) U1 :+: C1 ('MetaCons"NPlus"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"NMinus"
'PrefixI 'False) U1 :+: C1 ('MetaCons"NMult"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"NDiv"
'PrefixI 'False) U1 :+: C1 ('MetaCons"NConcat"
'PrefixI 'False) U1))))
The monomorphic expression type is a fixed point of the polymorphic one.
The main Nix expression type. As it is polimorphic, has a functor,
which allows to traverse expressions and map functions over them.
The actual NExpr type is a fixed point of this functor, defined
below.
Constructors
NConstant !NAtomConstants: ints, floats, bools, URIs, and null.
NStr !(NString r)A string, with interpolated expressions.
NSym !VarNameA variable. For example, in the expression
f a,fis represented asNSym "f"andaasNSym "a".NSym "x" ~ xNList ![r]A list literal.
NList [x,y] ~ [ x y ]NSet !Recursivity ![Binding r]An attribute set literal
NSet Recursive [NamedVar x y _] ~ rec { x = y; } NSet NonRecursive [Inherit Nothing [x] _] ~ { inherit x; }NLiteralPath !PathA path expression, which is evaluated to a store path. The path here can be relative, in which case it's evaluated relative to the file in which it appears.
NLiteralPath "/x" ~ /x NLiteralPath "x/y" ~ x/yNEnvPath !PathA path which refers to something in the Nix search path (the NIX_PATH environment variable. For example,
nixpkgs/pkgs.NEnvPath "x" ~ <x>NApp !r !rFunctional application (aka F.A., apply a function to an argument).
NApp f x ~ f xNUnary !NUnaryOp !rApplication of a unary operator to an expression.
NUnary NNeg x ~ - x NUnary NNot x ~ ! xNBinary !NBinaryOp !r !rApplication of a binary operator to two expressions.
NBinary NPlus x y ~ x + y NBinary NApp f x ~ f xNSelect !(Maybe r) !r !(NAttrPath r)Dot-reference into an attribute set, optionally providing an alternative if the key doesn't exist.
NSelect Nothing s (x :| []) ~ s.x NSelect (pure y) s (x :| []) ~ s.x or yNHasAttr !r !(NAttrPath r)Ask if a set contains a given attribute path.
NHasAttr s (x :| []) ~ s ? xNAbs !(Params r) !rA function literal (lambda abstraction).
NAbs (Param "x") y ~ x: yNLet ![Binding r] !rEvaluate the second argument after introducing the bindings.
NLet [] x ~ let in x NLet [NamedVar x y _] z ~ let x = y; in z NLet [Inherit Nothing x _] y ~ let inherit x; in yNIf !r !r !rIf-then-else statement.
NIf x y z ~ if x then y else zNWith !r !rEvaluate an attribute set, bring its bindings into scope, and evaluate the second argument.
NWith x y ~ with x; yNAssert !r !rChecks that the first argument is a predicate that is
truebefore evaluating the second argument.NAssert x y ~ assert x; yNSynHole !VarName
Instances36Functor, IsString, Foldable, Traversable, Eq1, Ord1, …
Functor NExprFDefined in hnix-0.17.0 · Nix.Expr.TypesIsString NExprDefined in hnix-0.17.0 · Nix.Expr.TypesWe make an IsString for expressions, where the string is interpreted as an identifier. This is the most common use-case...
Foldable NExprFDefined in hnix-0.17.0 · Nix.Expr.TypesTraversable NExprFDefined in hnix-0.17.0 · Nix.Expr.TypesEq1 NExprFDefined in hnix-0.17.0 · Nix.Expr.TypesOrd1 NExprFDefined in hnix-0.17.0 · Nix.Expr.TypesShow1 NExprFDefined in hnix-0.17.0 · Nix.Expr.TypesNFData1 NExprFDefined in hnix-0.17.0 · Nix.Expr.TypesBinary NExprLocDefined in hnix-0.17.0 · Nix.Expr.Types.AnnotatedHashable1 NExprFDefined in hnix-0.17.0 · Nix.Expr.TypesSerialise NExprDefined in hnix-0.17.0 · Nix.Expr.TypesSerialise NExprLocDefined in hnix-0.17.0 · Nix.Expr.Types.AnnotatedToExpr NExprDefined in hnix-0.17.0 · Nix.THGeneric1 NExprFDefined in hnix-0.17.0 · Nix.Expr.TypesLift NExprDefined in hnix-0.17.0 · Nix.Expr.TypesConvertible e t f m => ToValue Bool m (NExprF (NValue t f m))Defined in hnix-0.17.0 · Nix.ConvertConvertible e t f m => ToValue () m (NExprF (NValue t f m))Defined in hnix-0.17.0 · Nix.ConvertMonad m => Scoped NExprLoc (Reducer m)Defined in hnix-0.17.0 · Nix.ReduceEq r => Eq (NExprF r)Defined in hnix-0.17.0 · Nix.Expr.TypesData r => Data (NExprF r)Defined in hnix-0.17.0 · Nix.Expr.TypesOrd r => Ord (NExprF r)Defined in hnix-0.17.0 · Nix.Expr.TypesShow r => Show (NExprF r)Defined in hnix-0.17.0 · Nix.Expr.TypesGeneric (NExprF r)Defined in hnix-0.17.0 · Nix.Expr.TypesNFData r => NFData (NExprF r)Defined in hnix-0.17.0 · Nix.Expr.TypesBinary r => Binary (NExprF r)Defined in hnix-0.17.0 · Nix.Expr.TypesBinary r => Binary (NExprLocF r)Defined in hnix-0.17.0 · Nix.Expr.Types.AnnotatedHashable r => Hashable (NExprF r)Defined in hnix-0.17.0 · Nix.Expr.TypesFromJSON r => FromJSON (NExprF r)Defined in hnix-0.17.0 · Nix.Expr.TypesToJSON r => ToJSON (NExprF r)Defined in hnix-0.17.0 · Nix.Expr.TypesSerialise r => Serialise (NExprF r)Defined in hnix-0.17.0 · Nix.Expr.TypesSerialise r => Serialise (NExprLocF r)Defined in hnix-0.17.0 · Nix.Expr.Types.AnnotatedMonad m => MonadReader (Maybe Path, Scopes (Reducer m) NExprLoc) (Reducer m)Defined in hnix-0.17.0 · Nix.ReduceMonad m => MonadState (HashMap Path NExprLoc, HashMap Text Text) (Reducer m)Defined in hnix-0.17.0 · Nix.ReduceMonad m => MonadState (HashMap Path NExprLoc, HashMap Text Text) (StandardTF r m)Defined in hnix-0.17.0 · Nix.Standardtype Rep (NExprF r) = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"NExprF"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) ((((C1 ('MetaCons"NConstant"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NAtom)) :+: C1 ('MetaCons"NStr"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NString r)))) :+: (C1 ('MetaCons"NSym"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VarName)) :+: C1 ('MetaCons"NList"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [r])))) :+: ((C1 ('MetaCons"NSet"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Recursivity) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Binding r])) :+: C1 ('MetaCons"NLiteralPath"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Path))) :+: (C1 ('MetaCons"NEnvPath"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Path)) :+: (C1 ('MetaCons"NApp"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r)) :+: C1 ('MetaCons"NUnary"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NUnaryOp) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r)))))) :+: (((C1 ('MetaCons"NBinary"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NBinaryOp) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r))) :+: C1 ('MetaCons"NSelect"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe r)) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NAttrPath r))))) :+: (C1 ('MetaCons"NHasAttr"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NAttrPath r))) :+: C1 ('MetaCons"NAbs"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Params r)) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r)))) :+: ((C1 ('MetaCons"NLet"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Binding r]) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r)) :+: C1 ('MetaCons"NIf"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r)))) :+: (C1 ('MetaCons"NWith"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r)) :+: (C1 ('MetaCons"NAssert"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r)) :+: C1 ('MetaCons"NSynHole"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VarName)))))))type Rep1 NExprF = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"NExprF"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) ((((C1 ('MetaCons"NConstant"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NAtom)) :+: C1 ('MetaCons"NStr"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec1 NString))) :+: (C1 ('MetaCons"NSym"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VarName)) :+: C1 ('MetaCons"NList"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec1 [])))) :+: ((C1 ('MetaCons"NSet"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Recursivity) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) ([] :.: Rec1 Binding)) :+: C1 ('MetaCons"NLiteralPath"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Path))) :+: (C1 ('MetaCons"NEnvPath"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Path)) :+: (C1 ('MetaCons"NApp"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1) :+: C1 ('MetaCons"NUnary"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NUnaryOp) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1))))) :+: (((C1 ('MetaCons"NBinary"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NBinaryOp) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1)) :+: C1 ('MetaCons"NSelect"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec1 Maybe) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (NonEmpty :.: Rec1 NKeyName)))) :+: (C1 ('MetaCons"NHasAttr"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (NonEmpty :.: Rec1 NKeyName)) :+: C1 ('MetaCons"NAbs"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec1 Params) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1))) :+: ((C1 ('MetaCons"NLet"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) ([] :.: Rec1 Binding) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1) :+: C1 ('MetaCons"NIf"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1))) :+: (C1 ('MetaCons"NWith"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1) :+: (C1 ('MetaCons"NAssert"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1) :+: C1 ('MetaCons"NSynHole"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VarName)))))))
A KeyName is something that can appear on the left side of an
equals sign. For example, a is a KeyName in { a = 3; }, let a = 3;
in ..., {}.a or {} ? a.
Nix supports both static keynames (just an identifier) and dynamic
identifiers. Dynamic identifiers can be either a string (e.g.:
{ "a" = 3; }) or an antiquotation (e.g.: let a = "example";
in { ${a} = 3; }.example).
Note: There are some places where a dynamic keyname is not allowed. In particular, those include:
The RHS of a
bindinginsidelet:let ${"a"} = 3; in ...produces a syntax fail.The attribute names of an
inherit:inherit ${"a"};is forbidden.
Note: In Nix, a simple string without antiquotes such as "foo" is
allowed even if the context requires a static keyname, but the
parser still considers it a DynamicKey for simplicity.
Constructors
DynamicKey !(Antiquoted (NString r) r)DynamicKey (Plain (DoubleQuoted [Plain "x"])) ~ "x" DynamicKey (Antiquoted x) ~ ${x} DynamicKey (Plain (DoubleQuoted [Antiquoted x])) ~ "${x}"StaticKey !VarNameStaticKey "x" ~ x
Instances22Functor, Foldable, Traversable, Eq1, Ord1, Show1, …
Functor NKeyNameDefined in hnix-0.17.0 · Nix.Expr.TypesFoldable NKeyNameDefined in hnix-0.17.0 · Nix.Expr.TypesTraversable NKeyNameDefined in hnix-0.17.0 · Nix.Expr.TypesEq1 NKeyNameDefined in hnix-0.17.0 · Nix.Expr.TypesOrd1 NKeyNameDefined in hnix-0.17.0 · Nix.Expr.TypesShow1 NKeyNameDefined in hnix-0.17.0 · Nix.Expr.TypesNFData1 NKeyNameDefined in hnix-0.17.0 · Nix.Expr.TypesHashable1 NKeyNameDefined in hnix-0.17.0 · Nix.Expr.TypesEq r => Eq (NKeyName r)Defined in hnix-0.17.0 · Nix.Expr.TypesData r => Data (NKeyName r)Defined in hnix-0.17.0 · Nix.Expr.TypesOrd r => Ord (NKeyName r)Defined in hnix-0.17.0 · Nix.Expr.TypesRead r => Read (NKeyName r)Defined in hnix-0.17.0 · Nix.Expr.TypesShow r => Show (NKeyName r)Defined in hnix-0.17.0 · Nix.Expr.TypesIsString (NKeyName r)Defined in hnix-0.17.0 · Nix.Expr.TypesMost key names are just static text, so this instance is convenient.
Generic (NKeyName r)Defined in hnix-0.17.0 · Nix.Expr.TypesNFData r => NFData (NKeyName r)Defined in hnix-0.17.0 · Nix.Expr.TypesBinary r => Binary (NKeyName r)Defined in hnix-0.17.0 · Nix.Expr.TypesHashable r => Hashable (NKeyName r)Defined in hnix-0.17.0 · Nix.Expr.TypesFromJSON r => FromJSON (NKeyName r)Defined in hnix-0.17.0 · Nix.Expr.TypesToJSON r => ToJSON (NKeyName r)Defined in hnix-0.17.0 · Nix.Expr.TypesSerialise r => Serialise (NKeyName r)Defined in hnix-0.17.0 · Nix.Expr.Typestype Rep (NKeyName r) = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"NKeyName"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (C1 ('MetaCons"DynamicKey"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Antiquoted (NString r) r))) :+: C1 ('MetaCons"StaticKey"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VarName)))
Instances14Eq, Data, Ord, Read, Show, Generic, …
Eq NPosDefined in hnix-0.17.0 · Nix.Expr.TypesData NPosDefined in hnix-0.17.0 · Nix.Expr.TypesOrd NPosDefined in hnix-0.17.0 · Nix.Expr.TypesRead NPosDefined in hnix-0.17.0 · Nix.Expr.TypesShow NPosDefined in hnix-0.17.0 · Nix.Expr.TypesGeneric NPosDefined in hnix-0.17.0 · Nix.Expr.TypesSemigroup NPosDefined in hnix-0.17.0 · Nix.Expr.TypesNFData NPosDefined in hnix-0.17.0 · Nix.Expr.TypesBinary NPosDefined in hnix-0.17.0 · Nix.Expr.TypesHashable NPosDefined in hnix-0.17.0 · Nix.Expr.TypesFromJSON NPosDefined in hnix-0.17.0 · Nix.Expr.TypesToJSON NPosDefined in hnix-0.17.0 · Nix.Expr.TypesSerialise NPosDefined in hnix-0.17.0 · Nix.Expr.Typestype Rep NPos = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"NPos"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'True) (C1 ('MetaCons"NPos"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pos)))
Represents source positions. Source line & column positions change intensively during parsing, so they are declared strict to avoid memory leaks.
The data type is a reimplementation of Text.Megaparsec.Pos SourcePos.
Constructors
NSourcePosgetSourceName :: PathName of source file
getSourceLine :: !NPosLine number
getSourceColumn :: !NPosColumn number
Instances22Eq, Data, Ord, Read, Show, Generic, …
Eq NSourcePosDefined in hnix-0.17.0 · Nix.Expr.TypesData NSourcePosDefined in hnix-0.17.0 · Nix.Expr.TypesOrd NSourcePosDefined in hnix-0.17.0 · Nix.Expr.TypesRead NSourcePosDefined in hnix-0.17.0 · Nix.Expr.TypesShow NSourcePosDefined in hnix-0.17.0 · Nix.Expr.TypesGeneric NSourcePosDefined in hnix-0.17.0 · Nix.Expr.TypesNFData NSourcePosDefined in hnix-0.17.0 · Nix.Expr.TypesBinary NSourcePosDefined in hnix-0.17.0 · Nix.Expr.TypesHashable NSourcePosDefined in hnix-0.17.0 · Nix.Expr.TypesFromJSON NSourcePosDefined in hnix-0.17.0 · Nix.Expr.TypesToJSON NSourcePosDefined in hnix-0.17.0 · Nix.Expr.TypesSerialise NSourcePosDefined in hnix-0.17.0 · Nix.Expr.TypesConvertible e t f m => ToValue NSourcePos m (NValue' t f m (NValue t f m))Defined in hnix-0.17.0 · Nix.ConvertFromValue (AttrSet (Symbolic m), PositionSet) m (Symbolic m)Defined in hnix-0.17.0 · Nix.Lint(Convertible e t f m, FromValue a m (NValue t f m)) => FromValue (AttrSet a, PositionSet) m (Deeper (NValue' t f m (NValue t f m)))Defined in hnix-0.17.0 · Nix.ConvertToValue (AttrSet (Symbolic m), PositionSet) m (Symbolic m)Defined in hnix-0.17.0 · Nix.Lint(Convertible e t f m, ToValue a m (NValue t f m)) => ToValue (AttrSet a, PositionSet) m (Deeper (NValue' t f m (NValue t f m)))Defined in hnix-0.17.0 · Nix.ConvertConvertible e t f m => FromValue (AttrSet (NValue t f m), PositionSet) m (NValue' t f m (NValue t f m))Defined in hnix-0.17.0 · Nix.ConvertConvertible e t f m => ToValue (AttrSet (NValue t f m), PositionSet) m (NValue' t f m (NValue t f m))Defined in hnix-0.17.0 · Nix.ConvertMonadInfer m => FromValue (AttrSet (Judgment s), PositionSet) (InferT s m) (Judgment s)Defined in hnix-0.17.0 · Nix.Type.InferMonadInfer m => ToValue (AttrSet (Judgment s), PositionSet) (InferT s m) (Judgment s)Defined in hnix-0.17.0 · Nix.Type.Infertype Rep NSourcePos = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"NSourcePos"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (C1 ('MetaCons"NSourcePos"
'PrefixI 'True) (S1 ('MetaSel ('Just"getSourceName"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Path) :*: (S1 ('MetaSel ('Just"getSourceLine"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 NPos) :*: S1 ('MetaSel ('Just"getSourceColumn"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 NPos))))
An NString is a list of things that are either a plain string or an antiquoted expression. After the antiquotes have been evaluated, the final string is constructed by concatenating all the parts.
Constructors
DoubleQuoted ![Antiquoted Text r]Strings wrapped with double-quotes (
") can contain literal newline characters, but the newlines are preserved and no indentation is stripped.DoubleQuoted [Plain "x",Antiquoted y] ~ "x${y}"Indented !Int ![Antiquoted Text r]Strings wrapped with two single quotes (
'') can contain newlines, and their indentation will be stripped, but the amount stripped is remembered.Indented 1 [Plain "x"] ~ '' x'' Indented 0 [EscapedNewline] ~ ''''\n'' Indented 0 [Plain "x\n ",Antiquoted y] ~ '' x ${y}''
Instances27Functor, Foldable, Traversable, Eq1, Ord1, Read1, …
Functor NStringDefined in hnix-0.17.0 · Nix.Expr.TypesFoldable NStringDefined in hnix-0.17.0 · Nix.Expr.TypesTraversable NStringDefined in hnix-0.17.0 · Nix.Expr.TypesEq1 NStringDefined in hnix-0.17.0 · Nix.Expr.TypesOrd1 NStringDefined in hnix-0.17.0 · Nix.Expr.TypesRead1 NStringDefined in hnix-0.17.0 · Nix.Expr.TypesShow1 NStringDefined in hnix-0.17.0 · Nix.Expr.TypesNFData1 NStringDefined in hnix-0.17.0 · Nix.Expr.TypesHashable1 NStringDefined in hnix-0.17.0 · Nix.Expr.TypesFromJSON1 NStringDefined in hnix-0.17.0 · Nix.Expr.TypesToJSON1 NStringDefined in hnix-0.17.0 · Nix.Expr.TypesGeneric1 NStringDefined in hnix-0.17.0 · Nix.Expr.TypesEq r => Eq (NString r)Defined in hnix-0.17.0 · Nix.Expr.TypesData r => Data (NString r)Defined in hnix-0.17.0 · Nix.Expr.TypesOrd r => Ord (NString r)Defined in hnix-0.17.0 · Nix.Expr.TypesRead r => Read (NString r)Defined in hnix-0.17.0 · Nix.Expr.TypesShow r => Show (NString r)Defined in hnix-0.17.0 · Nix.Expr.TypesIsString (NString r)Defined in hnix-0.17.0 · Nix.Expr.TypesFor the the IsString instance, we use a plain doublequoted string.
Generic (NString r)Defined in hnix-0.17.0 · Nix.Expr.TypesNFData r => NFData (NString r)Defined in hnix-0.17.0 · Nix.Expr.TypesBinary r => Binary (NString r)Defined in hnix-0.17.0 · Nix.Expr.TypesHashable r => Hashable (NString r)Defined in hnix-0.17.0 · Nix.Expr.TypesFromJSON r => FromJSON (NString r)Defined in hnix-0.17.0 · Nix.Expr.TypesToJSON r => ToJSON (NString r)Defined in hnix-0.17.0 · Nix.Expr.TypesSerialise r => Serialise (NString r)Defined in hnix-0.17.0 · Nix.Expr.Typestype Rep (NString r) = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"NString"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (C1 ('MetaCons"DoubleQuoted"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Antiquoted Text r])) :+: C1 ('MetaCons"Indented"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Antiquoted Text r])))type Rep1 NString = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"NString"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (C1 ('MetaCons"DoubleQuoted"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) ([] :.: Rec1 (Antiquoted Text))) :+: C1 ('MetaCons"Indented"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) ([] :.: Rec1 (Antiquoted Text))))
Instances16Bounded, Enum, Eq, Data, Ord, Read, …
Bounded NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesEnum NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesEq NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesData NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesOrd NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesRead NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesShow NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesGeneric NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesNFData NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesBinary NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesHashable NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesFromJSON NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesToJSON NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesSerialise NUnaryOpDefined in hnix-0.17.0 · Nix.Expr.TypesNOp NUnaryOpDefined in hnix-0.17.0 · Nix.Parsertype Rep NUnaryOp = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"NUnaryOp"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (C1 ('MetaCons"NNeg"
'PrefixI 'False) U1 :+: C1 ('MetaCons"NNot"
'PrefixI 'False) U1)
Params represents all the ways the formal parameters to a
function can be represented.
Constructors
Param !VarNameFor functions with a single named argument, such as
x: x + 1.Param "x" ~ xParamSet !(Maybe VarName) !Variadic !(ParamSet r)Explicit parameters (argument must be a set). Might specify a name to bind to the set in the function body. The bool indicates whether it is variadic or not.
ParamSet Nothing False [("x",Nothing)] ~ { x } ParamSet (pure "s") True [("x", pure y)] ~ s@{ x ? y, ... }
Instances27Functor, Foldable, Traversable, Eq1, Ord1, Read1, …
Functor ParamsDefined in hnix-0.17.0 · Nix.Expr.TypesFoldable ParamsDefined in hnix-0.17.0 · Nix.Expr.TypesTraversable ParamsDefined in hnix-0.17.0 · Nix.Expr.TypesEq1 ParamsDefined in hnix-0.17.0 · Nix.Expr.TypesOrd1 ParamsDefined in hnix-0.17.0 · Nix.Expr.TypesRead1 ParamsDefined in hnix-0.17.0 · Nix.Expr.TypesShow1 ParamsDefined in hnix-0.17.0 · Nix.Expr.TypesNFData1 ParamsDefined in hnix-0.17.0 · Nix.Expr.TypesHashable1 ParamsDefined in hnix-0.17.0 · Nix.Expr.TypesFromJSON1 ParamsDefined in hnix-0.17.0 · Nix.Expr.TypesToJSON1 ParamsDefined in hnix-0.17.0 · Nix.Expr.TypesGeneric1 ParamsDefined in hnix-0.17.0 · Nix.Expr.TypesEq r => Eq (Params r)Defined in hnix-0.17.0 · Nix.Expr.TypesData r => Data (Params r)Defined in hnix-0.17.0 · Nix.Expr.TypesOrd r => Ord (Params r)Defined in hnix-0.17.0 · Nix.Expr.TypesRead r => Read (Params r)Defined in hnix-0.17.0 · Nix.Expr.TypesShow r => Show (Params r)Defined in hnix-0.17.0 · Nix.Expr.TypesIsString (Params r)Defined in hnix-0.17.0 · Nix.Expr.TypesGeneric (Params r)Defined in hnix-0.17.0 · Nix.Expr.TypesNFData r => NFData (Params r)Defined in hnix-0.17.0 · Nix.Expr.TypesBinary r => Binary (Params r)Defined in hnix-0.17.0 · Nix.Expr.TypesHashable r => Hashable (Params r)Defined in hnix-0.17.0 · Nix.Expr.TypesFromJSON r => FromJSON (Params r)Defined in hnix-0.17.0 · Nix.Expr.TypesToJSON r => ToJSON (Params r)Defined in hnix-0.17.0 · Nix.Expr.TypesSerialise r => Serialise (Params r)Defined in hnix-0.17.0 · Nix.Expr.Typestype Rep (Params r) = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"Params"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (C1 ('MetaCons"Param"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VarName)) :+: C1 ('MetaCons"ParamSet"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe VarName)) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Variadic) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ParamSet r)))))type Rep1 Params = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"Params"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (C1 ('MetaCons"Param"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VarName)) :+: C1 ('MetaCons"ParamSet"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe VarName)) :*: (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Variadic) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) ([] :.: (Tuple2 VarName :.: Rec1 Maybe)))))
Holds file positionng information for abstrations.
A type synonym for HashMap VarName NSourcePos.
Distinguishes between recursive and non-recursive. Mainly for attribute sets.
Constructors
NonRecursive{ ... }Recursiverec { ... }
Instances17Bounded, Enum, Eq, Data, Ord, Read, …
Bounded RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesEnum RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesEq RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesData RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesOrd RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesRead RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesShow RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesGeneric RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesSemigroup RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesMonoid RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesNFData RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesBinary RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesHashable RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesFromJSON RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesToJSON RecursivityDefined in hnix-0.17.0 · Nix.Expr.TypesSerialise RecursivityDefined in hnix-0.17.0 · Nix.Expr.Typestype Rep Recursivity = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"Recursivity"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (C1 ('MetaCons"NonRecursive"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Recursive"
'PrefixI 'False) U1)
Instances28Eq, Data, Ord, Read, Show, IsString, …
Eq VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesData VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesOrd VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesRead VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesShow VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesIsString VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesGeneric VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesNFData VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesBinary VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesHashable VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesFromJSON VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesToJSON VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesSerialise VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesToString VarNameDefined in hnix-0.17.0 · Nix.Expr.TypesToExpr VarNameDefined in hnix-0.17.0 · Nix.TH(Convertible e t f m, FromValue a m (NValue t f m)) => FromValue (AttrSet a) m (Deeper (NValue' t f m (NValue t f m)))Defined in hnix-0.17.0 · Nix.Convert(Convertible e t f m, ToValue a m (NValue t f m)) => ToValue (AttrSet a) m (Deeper (NValue' t f m (NValue t f m)))Defined in hnix-0.17.0 · Nix.ConvertConvertible e t f m => FromValue (AttrSet (NValue t f m)) m (NValue' t f m (NValue t f m))Defined in hnix-0.17.0 · Nix.ConvertConvertible e t f m => ToValue (AttrSet (NValue t f m)) m (NValue' t f m (NValue t f m))Defined in hnix-0.17.0 · Nix.ConvertFromValue (AttrSet (Symbolic m), PositionSet) m (Symbolic m)Defined in hnix-0.17.0 · Nix.Lint(Convertible e t f m, FromValue a m (NValue t f m)) => FromValue (AttrSet a, PositionSet) m (Deeper (NValue' t f m (NValue t f m)))Defined in hnix-0.17.0 · Nix.ConvertToValue (AttrSet (Symbolic m), PositionSet) m (Symbolic m)Defined in hnix-0.17.0 · Nix.Lint(Convertible e t f m, ToValue a m (NValue t f m)) => ToValue (AttrSet a, PositionSet) m (Deeper (NValue' t f m (NValue t f m)))Defined in hnix-0.17.0 · Nix.ConvertConvertible e t f m => FromValue (AttrSet (NValue t f m), PositionSet) m (NValue' t f m (NValue t f m))Defined in hnix-0.17.0 · Nix.ConvertConvertible e t f m => ToValue (AttrSet (NValue t f m), PositionSet) m (NValue' t f m (NValue t f m))Defined in hnix-0.17.0 · Nix.ConvertMonadInfer m => FromValue (AttrSet (Judgment s), PositionSet) (InferT s m) (Judgment s)Defined in hnix-0.17.0 · Nix.Type.InferMonadInfer m => ToValue (AttrSet (Judgment s), PositionSet) (InferT s m) (Judgment s)Defined in hnix-0.17.0 · Nix.Type.Infertype Rep VarName = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"VarName"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'True) (C1 ('MetaCons"VarName"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Instances15Eq, Data, Ord, Read, Show, Generic, …
Eq VariadicDefined in hnix-0.17.0 · Nix.Expr.TypesData VariadicDefined in hnix-0.17.0 · Nix.Expr.TypesOrd VariadicDefined in hnix-0.17.0 · Nix.Expr.TypesRead VariadicDefined in hnix-0.17.0 · Nix.Expr.TypesShow VariadicDefined in hnix-0.17.0 · Nix.Expr.TypesGeneric VariadicDefined in hnix-0.17.0 · Nix.Expr.TypesSemigroup VariadicDefined in hnix-0.17.0 · Nix.Expr.TypesMonoid VariadicDefined in hnix-0.17.0 · Nix.Expr.TypesNFData VariadicDefined in hnix-0.17.0 · Nix.Expr.TypesBinary VariadicDefined in hnix-0.17.0 · Nix.Expr.TypesHashable VariadicDefined in hnix-0.17.0 · Nix.Expr.TypesFromJSON VariadicDefined in hnix-0.17.0 · Nix.Expr.TypesToJSON VariadicDefined in hnix-0.17.0 · Nix.Expr.TypesSerialise VariadicDefined in hnix-0.17.0 · Nix.Expr.Typestype Rep Variadic = D1 ('MetaDataDefined in hnix-0.17.0 · Nix.Expr.Types"Variadic"
"Nix.Expr.Types"
"hnix-0.17.0-Iy75YcImuzK7FD0KGfkLv7"
'False) (C1 ('MetaCons"Closed"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Variadic"
'PrefixI 'False) U1)
The data type SourcePos represents source positions. It contains the name of the source file, a line number, and a column number. Source line and column positions change intensively during parsing, so we need to make them strict to avoid memory leaks.
Constructors
SourcePossourceName :: FilePathName of source file
sourceLine :: !PosLine number
sourceColumn :: !PosColumn number
Instances8Eq, Data, Ord, Read, Show, Generic, …
Eq SourcePosDefined in megaparsec-9.5.0 · Text.Megaparsec.PosData SourcePosDefined in megaparsec-9.5.0 · Text.Megaparsec.PosOrd SourcePosDefined in megaparsec-9.5.0 · Text.Megaparsec.PosRead SourcePosDefined in megaparsec-9.5.0 · Text.Megaparsec.PosShow SourcePosDefined in megaparsec-9.5.0 · Text.Megaparsec.PosGeneric SourcePosDefined in megaparsec-9.5.0 · Text.Megaparsec.PosNFData SourcePosDefined in megaparsec-9.5.0 · Text.Megaparsec.Postype Rep SourcePos = D1 ('MetaDataDefined in megaparsec-9.5.0 · Text.Megaparsec.Pos"SourcePos"
"Text.Megaparsec.Pos"
"megaparsec-9.5.0-9qCsOssMFen6qZuAj1Ay2f"
'False) (C1 ('MetaCons"SourcePos"
'PrefixI 'True) (S1 ('MetaSel ('Just"sourceName"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: (S1 ('MetaSel ('Just"sourceLine"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Pos) :*: S1 ('MetaSel ('Just"sourceColumn"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Pos))))
Construction of Pos from Int. The function throws InvalidPosException when given a non-positive argument.