Replies: 1 comment 4 replies
-
I'm not overly keen on the idea if I'm totally honest, it's a bit too magic. Anyway, don't use Result, it isn't meant for public consumption. Use Fin. I think there's a ToFin on Try. You could also use Eff which is more for side-effecting functions. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Since LanguageExt provides types like Result or Error, why not use them, and add some source generators, that would modify each method under the following conditions:
SurroundTryAttribute
.That would cause the method to be transformed in the compile time into a
try{existing code}-catch
block, and when an exception would be thrown, it wouldn't throw the exception, it would return it instead in the Error type.I know I can use the
Prelude.Try()
, but is there an actual built-in way to convert it into the Error and Result type, or do I need to do it all myself? Source generators like this may improve the performance of the library, and reduce the code required to accomplish a (repetitive) task.Beta Was this translation helpful? Give feedback.
All reactions