If you want to just play around I recommend using the repl:
$ nix repl '<nixpkgs>'
warning: future versions of Nix will require using `--file` to load a file
Welcome to Nix 2.18.1. Type :? for help.
Loading installable ''...
Added 19947 variables.
nix-repl> korora = import (builtins.fetchGit "https://github.com/adisbladis/korora.git") { inherit lib; }
nix-repl> t = korora.string
nix-repl> t.check 1234
error:
… while calling the 'throw' builtin
at /nix/store/n5jj2abpas1ihg5l26cysyl8rak7pa21-source/default.nix:101:50:
100| inherit name verify;
101| check = v: if verify v == null then v else throw (verify v);
| ^
102| };
error: Expected type 'string' but value '1234' is of type 'int'