aoc2019-0.1.0.0: Development environment for Advent of Code challenges

Safe HaskellNone
LanguageHaskell2010

AOC.Common.Subset

Synopsis

Documentation

findSubset Source #

Arguments

:: (Monad m, Ord a) 
=> (Set a -> m Ordering)

tester

-> Bool

whether or not to include empty set and full set

-> Set a

full set of items

-> m (Maybe (Set a))

subset that matches tester

testFinder Source #

Arguments

:: Bool

whether or not to include empty set and full set

-> Int 
-> Map (Set Int) Int 

Get the number of guesses needed for each possible subset, for n items.

allBranches :: Ord a => Bool -> Set a -> [(Set a, [(Set a, Ordering)])] Source #

buildDTree :: Ord a => Bool -> Set a -> Maybe (DTree a) Source #

data DTree a Source #

Constructors

DNode 

Fields

Instances
Show a => Show (DTree a) Source # 
Instance details

Defined in AOC.Common.Subset

Methods

showsPrec :: Int -> DTree a -> ShowS #

show :: DTree a -> String #

showList :: [DTree a] -> ShowS #

Recursive (DTree a) Source # 
Instance details

Defined in AOC.Common.Subset

Methods

project :: DTree a -> Base (DTree a) (DTree a) #

cata :: (Base (DTree a) a0 -> a0) -> DTree a -> a0 #

para :: (Base (DTree a) (DTree a, a0) -> a0) -> DTree a -> a0 #

gpara :: (Corecursive (DTree a), Comonad w) => (forall b. Base (DTree a) (w b) -> w (Base (DTree a) b)) -> (Base (DTree a) (EnvT (DTree a) w a0) -> a0) -> DTree a -> a0 #

prepro :: Corecursive (DTree a) => (forall b. Base (DTree a) b -> Base (DTree a) b) -> (Base (DTree a) a0 -> a0) -> DTree a -> a0 #

gprepro :: (Corecursive (DTree a), Comonad w) => (forall b. Base (DTree a) (w b) -> w (Base (DTree a) b)) -> (forall c. Base (DTree a) c -> Base (DTree a) c) -> (Base (DTree a) (w a0) -> a0) -> DTree a -> a0 #

Corecursive (DTree a) Source # 
Instance details

Defined in AOC.Common.Subset

Methods

embed :: Base (DTree a) (DTree a) -> DTree a #

ana :: (a0 -> Base (DTree a) a0) -> a0 -> DTree a #

apo :: (a0 -> Base (DTree a) (Either (DTree a) a0)) -> a0 -> DTree a #

postpro :: Recursive (DTree a) => (forall b. Base (DTree a) b -> Base (DTree a) b) -> (a0 -> Base (DTree a) a0) -> a0 -> DTree a #

gpostpro :: (Recursive (DTree a), Monad m) => (forall b. m (Base (DTree a) b) -> Base (DTree a) (m b)) -> (forall c. Base (DTree a) c -> Base (DTree a) c) -> (a0 -> Base (DTree a) (m a0)) -> a0 -> DTree a #

type Base (DTree a) Source # 
Instance details

Defined in AOC.Common.Subset

type Base (DTree a)

dTestF :: DTreeF a r -> Set a Source #

dLTF :: DTreeF a r -> Maybe r Source #

dGTF :: DTreeF a r -> Maybe r Source #