From c1598d167e5e3714b70cddef4fa3458e2a03635e Mon Sep 17 00:00:00 2001 From: Shea Levy <shea@shealevy.com> Date: Mon, 31 Dec 2012 13:59:30 -0500 Subject: [PATCH] Simplify lib.typeOf --- pkgs/lib/types.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/lib/types.nix b/pkgs/lib/types.nix index 6bc2e0f1ecb3..1cb1185b8bb8 100644 --- a/pkgs/lib/types.nix +++ b/pkgs/lib/types.nix @@ -11,7 +11,7 @@ with import ./trivial.nix; rec { hasType = x: isAttrs x && x ? _type; - typeOf = x: if hasType x then x._type else ""; + typeOf = x: x._type or ""; setType = typeName: value: value // { _type = typeName;