
7 Aug
2016
7 Aug
'16
9:13 a.m.
True: distinct types help. In this case a function expects a couple bool args so the newtypes help ensure that correct args are passed in correct order. However when working with vals within a function, it may be handy to be able to deduce bool from the newtype, at least to be used with if. This may introduce complexity so not suggesting / requesting anything. Just thought: something might be already available. For example, num-like newtypes can be added, compared as are, without the need to extract the num. Num newtypes conveniently can be derived with "deriving". A function you suggest is good and it works. Thank you.