<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
There's no standard way of doing such things, beyond the tenuously
connected example of the [option] monad. "urweb-monad-pack" may
indeed be the best starting point.<br>
<br>
<div class="moz-cite-prefix">On 04/04/2016 06:49 AM,
<a class="moz-txt-link-abbreviated" href="mailto:foldr@tutanota.com">foldr@tutanota.com</a> wrote:<br>
</div>
<blockquote cite="mid:KEVt0RH--3-0@tutanota.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
Adam, I thought that [error] could be used as the last resort -
when something severe happens. <br>
<br>
What would be the right approach to get rid of multiple enclosed
case/if statements? Imagine user input validation in a complex
data entry form - all data inconsistencies produce different error
messages and all require form resubmission. The code at [1] would
be an example of how such error handling could be rewritten, but I
would like to declare multiple error types and pattern match them.
<br>
<br>
[1] <a moz-do-not-send="true"
href="https://github.com/grwlf/urweb-monad-pack/blob/master/test/TestError1.ur"
target="_blank">https://github.com/grwlf/urweb-monad-pack/blob/master/test/TestError1.ur</a><br>
<br>
<br>
<br>
4. Apr 2016 21:48 by <a moz-do-not-send="true"
href="mailto:adamc@csail.mit.edu" target="_blank">adamc@csail.mit.edu</a>:<br>
<br>
<blockquote class="tutanota_quote" style="border-left: 1px solid
#93A3B8; padding-left: 10px; margin-left: 5px;"> The idiomatic
approach is just to call the [error] function to end execution,
with an error message.<br>
<br>
<div class="moz-cite-prefix">On 04/03/2016 10:24 PM, <a
moz-do-not-send="true" target="_blank"
class="moz-txt-link-abbreviated"
href="mailto:foldr@tutanota.com"><a class="moz-txt-link-abbreviated" href="mailto:foldr@tutanota.com">foldr@tutanota.com</a></a>
wrote:<br>
</div>
<blockquote class="thunderbird_quote" style="border-left: 1px
solid #93a3b8 ; padding-left: 10px ; margin-left: 5px"> <span
style="background-color: rgba( 255 , 255 , 255 , 0 )">Hi
all,<br>
<br>
How do I handle application errors in Ur? Is there a
preferred method which allows to check whether all errors
have their handlers or not?<br>
<br>
I am looking for maybe something similar to the below:<br>
<a moz-do-not-send="true" target="_blank"
href="http://sylvain-henry.info/home/posts/2016-03-18-first-experiments-with-dependent-types.html">http://sylvain-henry.info/home/posts/2016-03-18-first-experiments-with-dependent-types.html</a></span><br>
</blockquote>
</blockquote>
</blockquote>
</body>
</html>