<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<blockquote
cite="mid:CACN--9B2kEBA2iO6ARFE0-pd2DxN6-LHFbjrQDPbrEZSMWydug@mail.gmail.com"
type="cite">
<div dir="ltr">You can avoid the underscores by defining the
constants as pattern synonyms so that they are syntactically
more like constructors. This also, of course, allows you to use
them as patterns, which can also be nice for constants.
<div class="gmail_extra"><br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">Off topic, but
sometimes when I find myself using magic values I
can't/won't get rid off, I'll just apply the good old
habits learned in Java times. For example you might find
a section at the top of a file with things like
<pre><span class="m_-6745835357095620959m_1563677389548060987pl-c1"> _DAYS_IN_A_WEEK_ , _KNOWN_SIZE_OF_POINT_ :: INT<span class="m_-6745835357095620959m_1563677389548060987pl-c1">
-- | Seems to be a good approximation for now
_DAYS_IN_A_WEEK_ = 7
-- | When you ask "What's the point", this will not answer your question.
_KNOWN_SIZE_OF_POINT_ = </span>65
</span><span class="m_-6745835357095620959m_1563677389548060987pl-c1"></span></pre>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
<br>
<p>Nice! This seems a bit evil, and not a full substitute. But it
also helps hijack syntax highlighting, and it forces users to use
a recent-ish version of GHC. I consider that A Good Thing™.</p>
<p>Now… as everything is “constant” in Haskell, on to define
everything in capital letter patterns and return to good old COBOL
times!</p>
<p><span class="emojione e1-1F37A"><span>🍺</span></span> Wohoo!</p>
<p><br>
</p>
<p>Cheers,<br>
MarLinn</p>
</body>
</html>