ANNOUNCE: countable-1.0

Ashley Yakeley ashley at
Mon Sep 6 06:46:18 EDT 2010

countable: Countable, Searchable, Finite, Empty classes.

   class Countable, for countable types
   class AtLeastOneCountable, for countable types that have at least one 
   class InfiniteCountable, for infinite countable types
   class Searchable, for types that can be searched over
   class Finite, for finite types
   class Empty, for empty types
   data Nothing, an empty type

Also includes these orphan instances:

   instance (Searchable a,Eq b) => Eq (a -> b)
   instance (Finite a) => Foldable ((->) a)
   instance (Finite a) => Traversable ((->) a)
   instance (Show a,Finite a,Show b) => Show (a -> b)

It turns out Searchable includes some infinite types. Specifically, 
countable implements this:

   instance (Countable c,Searchable s) => Searchable (c -> s)

using the algorithm described here:

I would welcome improvements.
cabal install countable
darcs get

See also this thread:

More information about the Libraries mailing list