[Nix-dev] Re: Proposal: tryCatch function
Michael Raskin
7c6f434c at mail.ru
Tue Jan 6 11:49:42 CET 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Andres Loeh wrote:
> Mainly because of the already mentioned trickyness that exceptions in
> lazy languages tend to escape their surrounding try-block, try-catch
> is generally considered not a very useful construct in the face of laziness.
>
> The escaping should not only be a problem for functions, but also for
> any form of compound lazy data (i.e., attribute sets in the Nix language).
>
> <religion>Exceptions in a pure language are evil and should be avoided,
> not encouraged.</religion>
We have enabled side effects already. Without caring about evaluation
order. I mean "trace" builtin. It has 2 main properties, though: it
never changes what derivations are constructed and it only gives
end-user a bit more information that can be filtered out if not helpful.
tryCatch lacks the first property, and because of that I consider it
harmful. tryRethrow is just like trace, and I am not sure that IO purity
is worth preserving (if it doesn't affect actual build purity).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iQEcBAEBAgAGBQJJYzdDAAoJEE6tnN0aWvw3HbsIAJ3+quaQtWt59gy2peNe07bG
1tJOfSLwzKjfRXIsn4pgbFciO65Y3Eno7vS6yirxfCUyQEGC730b/9FpfGZ1Q2LX
3j0OE2+T55S8bVsk2sdEBK8Ogf0gknpMLRcmtcffpoyWSpNtE8AkBcM6mjz2z5iQ
xJRSJiJ2X1/NxJ8WFLjo5GHVoxLNWnY5Q3Co6dLXYNdAeT8Ku2AYpqb0sn962aOH
WP7DC2REp2Hl6XxJ0Wap7TJJjiD0rWNMgiwNMmLpmpsKzl3ZWDn/cNPc6OEqLHuT
ZOxHLu5WT8djX843joUN7HkxLGmUYRVfA/K/5Js+OzgTMgv4txoIm27mm0qUJYo=
=ELBn
-----END PGP SIGNATURE-----
More information about the nix-dev
mailing list