Closed lukejoshua closed 4 years ago
Thanks. That would be a good addition.
There is a problem though. As you might have noticed, the library establishes a naming convention, where typeclass names are nouns standing for the functionality they provide. So we need to find some proper noun name.
Perhaps "Interval" would be more suitable?
Perhaps "Interval" would be more suitable?
Also Bounds
and Limitation
. Limitation has more of the functionality ring to it, but Bounds reminds of Bounded. Hmm..
Of those two I think Bounds
would work best.
What about Limits
or Limit
instead?
Let's go with Bounds
Since the other typeclasses expose their respective record constructors, should Bounds
continue doing so instead of making it an opaque type?
Since the other typeclasses expose their respective record constructors, should
Bounds
continue doing so instead of making it an opaque type?
Sure!
Since now bounds is just an alias to Bounds, there's no point in having it. Let's remove it altogether. It'll only confuse people.
Apart from that, I'm ready to merge.
Also it'll be nice to add a mapping function.
Thanks! Great work
Add a Bounded typeclass to represent types with a minimum and maximum value.
The following instances have been included:
Int
Char
Bool
Order
()
Bounded pairs and triples can be derived from the member types, provided they are themselves bounded.