| Copyright | (c) Erich Gut |
|---|---|
| License | BSD3 |
| Maintainer | zerich.gut@gmail.com |
| Safe Haskell | None |
| Language | Haskell2010 |
OAlg.Entity.Sequence.Set
Contents
Description
sets of ordered entities.
Synopsis
- newtype Set x = Set [x]
- set :: Ord x => [x] -> Set x
- setSpan :: Set x -> Span x
- setxs :: Set x -> [x]
- setSqc :: Ord x => (i -> Maybe x) -> Set i -> Set x
- setMap :: Ord y => (x -> y) -> Set x -> Set y
- isSubSet :: Ord x => Set x -> Set x -> Bool
- setPower :: Set x -> Set (N, Set (Set x))
- setFilter :: (x -> Bool) -> Set x -> Set x
- setTakeN :: N -> Set x -> Set x
- setEmpty :: Set x
- setIsEmpty :: Set x -> Bool
- setUnion :: Ord x => Set x -> Set x -> Set x
- setIntersection :: Ord x => Set x -> Set x -> Set x
- setDifference :: Ord x => Set x -> Set x -> Set x
- setIndex :: Ord x => Set x -> x -> Maybe N
- xSet :: Ord x => N -> X x -> X (Set x)
- prpSetUnion :: (Ord x, Show x) => X (Set x) -> Statement
Set
set of ordered entities in x.
Property Let s = be in Set xs for a ordered Set xEntity type x,
then holds:
Note The canonical ordering Ord and the subset ordering PartiallyOrdered are not equivalent.
Constructors
| Set [x] |
Instances
setMap :: Ord y => (x -> y) -> Set x -> Set y Source #
mapping of sets.
Note This works only for finite sets!
setPower :: Set x -> Set (N, Set (Set x)) Source #
the power set of a given set, grouped by there length.
Operations
setIsEmpty :: Set x -> Bool Source #
checking for the empty set.
Lookup
setIndex :: Ord x => Set x -> x -> Maybe N Source #
the index of an element, where the elements of the given set are indexed from 0.
Examples
>>>setIndex (Set ['a'..'x']) 'c'Just 2
X
xSet :: Ord x => N -> X x -> X (Set x) Source #
random variable of sets with a maximal length of the given length.