
3 May
2012
3 May
'12
11:36 a.m.
Hi, I'm writing a program like this: data B = B Int data A = Safe Int | Unsafe Int createB :: A -> B createB (Safe i) = B i createB (Unsafe i) = error "This is not allowed" Unfortunately, the situation when createB is called with an Unsafe value is only checked at runtime. If I omit the second case, it is not an error to not be exhaustive :-( Is there a way to make it a compile time error?? Thanks! -- Ismael