ANNOUNCE: countable-1.0

Ashley Yakeley ashley at semantic.org
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 
value
   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:

 
http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/

I would welcome improvements.

http://hackage.haskell.org/package/countable-0.1
cabal install countable
darcs get http://code.haskell.org/countable/

See also this thread:
http://thread.gmane.org/gmane.comp.lang.haskell.cafe/73275




More information about the Libraries mailing list