1: # Like typeOf but spots derivations (a subtype of sets) and callables (functions 2: # or sets with a '__functor' attribute). 3: { callPackage, hello, isCallable, lib }: 4: 5: x: 6: if lib.isDerivation x then 7: "derivation" 8: else if isCallable x then 9: "callable" 10: else 11: builtins.typeOf x