Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- int2natural :: Int -> Natural
- powerSet :: Ord a => Set a -> Set (Set a)
- dropEach :: Ord a => Set a -> Set (Set a)
- powerset2matrix :: Set (Set a) -> [[a]]
- printMappings :: Show a => [[a]] -> IO ()
- (>>>) :: Category k cat => cat a b -> cat b c -> cat a c
- traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
Documentation
int2natural :: Int -> Natural Source
powerSet :: Ord a => Set a -> Set (Set a) Source
the power set of a set of values.
>>>
(powerset2matrix . powerSet . Set.fromList) [1..3]
[[],[1],[2],[3],[1,2],[1,3],[2,3],[1,2,3]]
dropEach :: Ord a => Set a -> Set (Set a) Source
>>>
(powerset2matrix . dropEach . Set.fromList) [1..3]
[[1,2],[1,3],[2,3]]
powerset2matrix :: Set (Set a) -> [[a]] Source
convert a power set to an isomorphic matrix, sorting the entries.
(for doctest)
printMappings :: Show a => [[a]] -> IO () Source
(for doctest)
traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
Map each element of a structure to an action, evaluate these
actions from left to right, and ignore the results. For a version
that doesn't ignore the results see traverse
.