
27 Oct
2004
27 Oct
'04
6:52 a.m.
I think someone else mentioned using functions earlier, rather than a datatype why not define: data Interval = Interval { isin :: Float -> Bool } Then each range becomes a function definition, for example: myInterval = Interval { isin r | r == 0.6 = True | r > 0.7 && r < 1.0 = True | otherwise = False } Then you can test with: (isin myInterval 0.6) Keean