Hi, I&#39;m writing a program like this:<div><br></div><div>data B = B Int</div><div>data A = Safe Int | Unsafe Int</div><div><br></div><div>createB :: A -&gt; B</div><div>createB (Safe i) = B i</div><div>createB (Unsafe i) = error &quot;This is not allowed&quot;</div>
<div><br></div><div>Unfortunately, the situation when createB is called with an Unsafe value is only checked at runtime. </div><div>If I omit the second case, it is not an error to not be exhaustive :-(</div><div><br></div>
<div>Is there a way to make it a compile time error??</div><div><br></div><div>Thanks!</div><div>-- <br>Ismael<br><br>
</div>