<html><head></head><body><div>Am Dienstag, den 25.09.2018, 02:05 +0530 schrieb Harendra Kumar:</div><blockquote type="cite"><div dir="ltr"><div dir="ltr">That's where I started. I already use a newtype with GND for this, and it looks like this:<br><div class="gmail_quote"><div><br></div><div><div><font face="monospace"><b>newtype</b> Count = Count Int64</font></div><div><font face="monospace"> <b>deriving</b> ( Eq</font></div><div><font face="monospace"> , Read</font></div><div><font face="monospace"> , Show</font></div><div><font face="monospace"> , Enum</font></div><div><font face="monospace"> , Bounded</font></div><div><font face="monospace"> , Num</font></div><div><font face="monospace"> , Real</font></div><div><font face="monospace"> , Integral</font></div><div><font face="monospace"> , Ord</font></div><div><font face="monospace"> )</font></div></div><div><br></div><div>The problem is that most programmers are lazy or hard pressed for time and having to write a <font face="monospace"><b>newtype</b></font> with a big list of instances actually discourages the use of <font face="monospace"><b>newtype</b></font>s freely for this case, they may just make it a habit to let it go. We can't just deny this and say that programmers must be disciplined. They will often try taking the path of least effort.</div></div></div></div></blockquote><div><br></div><div>I think that the time it takes to come up with and write down such explicit lists is usually small compared to the time it takes to do all the other development. And once you have made the instantiation lists explicit, you will probably save time in the future, because bugs will detected automatically more often. The latter point is something that is often overlooked: people are under time pressure and strive for quick solutions but spend more time in the long run this way.</div><div><br></div><div>All the best,</div><div>Wolfgang</div></body></html>