# Primitives


Primitive types: String, Int, Bool, Float, Attrs, Path, Derivation, Function, Null, Unit, Any.

## `Any`

_Any: top type; every Nix value inhabits it, backed by `H.any` — used as the lossy fallback kernel for approximate types._

Top type. Every value inhabits `Any`. Approximate types fall back to `Any` for their kernel slot.

## `Attrs`

_Attrs: primitive type for any Nix attribute set; backed by `H.attrs` — accepts every attrset including `{}`, never checks field shape._

Attribute set type. Any attrset, including `{}`. Use `Record` for declared-field shape.

## `Bool`

_Bool: primitive type whose only inhabitants are `true` and `false`; backed by the `H.bool` kernel type with precise kernel decision._

Boolean type. Inhabited by `true` and `false`.

## `Derivation`

_Derivation: primitive type for Nix derivation values — attrsets carrying `type = "derivation"`. The store-producing irreducible value category that makes Nix Nix; rejects plain attrsets, strings, and paths._

Derivation type. Nix derivation values (built via `mkDerivation` /
`runCommand` / `stdenv.mkDerivation` etc.).

Membership is decided structurally: any attrset with
`type = "derivation"` qualifies. Bare attrsets (no `type` field),
strings (e.g. `"pkgs.hello"`), and paths (e.g. `./foo`) are
rejected — derivations are a distinct value category.

## `Float`

_Float: primitive type whose values are Nix floating-point numbers; backed by `H.float_` and decided by `builtins.isFloat` (excludes ints)._

Float type. Inhabited by Nix floats; rejects integers.

## `Function`

_Function: primitive type for Nix lambdas; backed by `H.function_` and decided by `builtins.isFunction` — argument/result shape is not introspected._

Function type. Any Nix lambda. The arrow shape (`a -> b`) is not checked at this level — use `H.forall` for that.

## `Int`

_Int: primitive type whose values are Nix integers; backed by the `H.int_` kernel type and decided by `builtins.isInt` (excludes floats)._

Integer type. Inhabited by Nix integer values; rejects floats.

## `Null`

_Null: primitive type whose only inhabitant is `null`; isomorphic to `Unit` and backed by the `H.unit` kernel type._

Null type. Only `null` inhabits it. Isomorphic to `Unit`.

## `Path`

_Path: primitive type for Nix path values; rejects strings — paths and strings are distinct value categories in Nix._

Path type. Nix path values (e.g. `./foo`); not interchangeable with strings.

## `String`

_String: primitive type whose values are Nix strings; backed by the `H.string` kernel type and decided by `builtins.isString` at the elaborator._

String type. Inhabited by Nix string values.

## `Unit`

_Unit: primitive type with one inhabitant `null`; isomorphic to `Null`, backed by the `H.unit` kernel type — the trivial / terminal type._

Unit type. Trivial type with one inhabitant. Isomorphic to `Null`.

