board-games-0.1.0.6: Three games for inclusion in a web server

Game.Mastermind.CodeSet.Tree

Synopsis

# Documentation

data T a Source #

Products [(a,b),(c,d)] expresses a x b union c x d, where x denotes the set product.

Constructors

 End Products (Map (Set a) (T a))

Instances

 Source # Methodsunion :: Ord a => T a -> T a -> T a Source #intersection :: Ord a => T a -> T a -> T a Source #unit :: T a Source #leftNonEmptyProduct :: Set a -> T a -> T a Source #flatten :: Ord a => T a -> [[a]] Source #symbols :: Ord a => T a -> Set a Source #null :: T a -> Bool Source #size :: T a -> Integer Source #select :: T a -> Integer -> [a] Source #compress :: Ord a => T a -> T a Source # Show a => Show (T a) Source # MethodsshowsPrec :: Int -> T a -> ShowS #show :: T a -> String #showList :: [T a] -> ShowS #

flatten :: Ord a => T a -> [[a]] Source #

symbols :: Ord a => T a -> Set a Source #

select :: T a -> Integer -> [a] Source #

union :: Ord a => T a -> T a -> T a Source #

We could try to merge set products. I'll first want to see, whether this is needed in a relevant number of cases.

intersection :: Ord a => T a -> T a -> T a Source #

normalizeProducts :: [(Set a, T a)] -> [(Set a, T a)] Source #

Remove empty set products.

newtype Indexable a Source #

This allows (T a) to be a key in a Map. I do not want an Ord (T a) instance, since it makes no sense and it requires an Eq (T a) instance that is either expensive (if it means set equality) or confusing (if it means structural equality).

Constructors

 Indexable (T a)

Instances

 Eq a => Eq (Indexable a) Source # Methods(==) :: Indexable a -> Indexable a -> Bool #(/=) :: Indexable a -> Indexable a -> Bool # Ord a => Ord (Indexable a) Source # Methodscompare :: Indexable a -> Indexable a -> Ordering #(<) :: Indexable a -> Indexable a -> Bool #(<=) :: Indexable a -> Indexable a -> Bool #(>) :: Indexable a -> Indexable a -> Bool #(>=) :: Indexable a -> Indexable a -> Bool #max :: Indexable a -> Indexable a -> Indexable a #min :: Indexable a -> Indexable a -> Indexable a #

compress :: Ord a => T a -> T a Source #

member :: Ord a => [a] -> T a -> Bool Source #

null :: T a -> Bool Source #