dmwit / universe

Classes for types where we know all the values
BSD 3-Clause "New" or "Revised" License
37 stars 17 forks source link

Could we have cardinality for universeF ? #28

Closed jachymb closed 7 years ago

jachymb commented 7 years ago

It would be nice to have

cardinality :: Integer
cardinality = genericLength universeF

or something like that which could be overridden for efficiency in the UniverseF typeclass.

dmwit commented 7 years ago

I think we could merge in commit be644eaa. I originally started that thinking it would help write Enum instances, but I agree it's handy even on its own.