Skip to content

What does the Validation construct actually buy us? #966

Answered by WardBrian
WardBrian asked this question in Q&A
Discussion options

You must be logged in to vote

I've spent the past day digging around in the typechecker and prototyping an alternative style, so I want to share some of what I've thought about. I want to be clear I'm not trying to start an exception-monad holy war or anything, they are 100% the correct thing for errors that need to be handled and recovered from and a lot of other applications.

But, when the correct behavior for an error is to stop the computation and report the error, which is how our typechecker ultimately behaves right now, I really think it's better to do the simpler solution, even if it's not the most 'functional' thing to do [1].

Here are the final 6 lines of the typechecker at the moment (this function is ~70 l…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@WardBrian
Comment options

WardBrian Sep 16, 2021
Maintainer Author

Comment options

WardBrian
Sep 16, 2021
Maintainer Author

You must be logged in to vote
2 replies
@SteveBronder
Comment options

@WardBrian
Comment options

WardBrian Sep 17, 2021
Maintainer Author

Comment options

WardBrian
Sep 17, 2021
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by WardBrian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants