| Copyright | (c) Erich Gut |
|---|---|
| License | BSD3 |
| Maintainer | zerich.gut@gmail.com |
| Safe Haskell | None |
| Language | Haskell2010 |
OAlg.Entity.Sequence.Graph
Contents
Description
graphs of entities in x.
Synopsis
- newtype Graph i x = Graph [(i, x)]
- gphLength :: Graph i x -> N
- gphxs :: Graph i x -> [(i, x)]
- gphSqc :: (i -> Maybe x) -> Set i -> Graph i x
- gphLookup :: Ord i => Graph i x -> i -> Maybe x
- gphTakeN :: N -> Graph i x -> Graph i x
- gphSetFilter :: (b -> Bool) -> Graph a (Set b) -> Graph a (Set b)
- gphUnion :: (Ord a, Ord b) => Graph a (Set b) -> Graph a (Set b) -> Graph a (Set b)
- gphIntersection :: (Ord a, Ord b) => Graph a (Set b) -> Graph a (Set b) -> Graph a (Set b)
- gphDifference :: (Ord a, Ord b) => Graph a (Set b) -> Graph a (Set b) -> Graph a (Set b)
- isSubGraph :: (Ord a, Ord b) => Graph a (Set b) -> Graph a (Set b) -> Bool
- gphset :: Graph a (Set b) -> Set (a, b)
- setgph :: Eq a => Set (a, b) -> Graph a (Set b)
Graph
mapping from an ordered index type i to a Entity type x.
Property Let g = be in Graph ixs for a ordered Graph i xEntity
type i and Entity type x, then holds:
Constructors
| Graph [(i, x)] |
Instances
| Functor (Graph i) Source # | |
| Filterable (Graph i) Source # | |
| (Entity x, Entity i, Ord i) => ConstructableSequence (Graph i) i x Source # | |
| Ord i => Sequence (Graph i) i x Source # | |
| (Show i, Show x) => Show (Graph i x) Source # | |
| (Eq i, Eq x) => Eq (Graph i x) Source # | |
| (Ord i, Ord x) => Ord (Graph i x) Source # | |
| (Ord a, Ord b) => Erasable (Graph a (Set b)) Source # | |
| (Ord a, Ord b) => Logical (Graph a (Set b)) Source # | |
| LengthN (Graph i x) Source # | |
| (Entity x, Entity i, Ord i) => Validable (Graph i x) Source # | |
| (Ord a, Ord b) => Lattice (Graph a (Set b)) Source # | |
Defined in OAlg.Entity.Sequence.Graph | |
| (Ord a, Ord b) => Empty (Graph a (Set b)) Source # | |
| (Ord a, Ord b) => PartiallyOrdered (Graph a (Set b)) Source # | |
gphSqc :: (i -> Maybe x) -> Set i -> Graph i x Source #
the induced graph given by a set of indices and a mapping.
gphSetFilter :: (b -> Bool) -> Graph a (Set b) -> Graph a (Set b) Source #
filtering elements of the associated sets.
Lattice
gphUnion :: (Ord a, Ord b) => Graph a (Set b) -> Graph a (Set b) -> Graph a (Set b) Source #
the union of two graphs on sets.
gphIntersection :: (Ord a, Ord b) => Graph a (Set b) -> Graph a (Set b) -> Graph a (Set b) Source #
the intersection of two graphs on sets.
gphDifference :: (Ord a, Ord b) => Graph a (Set b) -> Graph a (Set b) -> Graph a (Set b) Source #
the difference of two graphs on sets.
isSubGraph :: (Ord a, Ord b) => Graph a (Set b) -> Graph a (Set b) -> Bool Source #
testing of being a sub graph.
Conversions
gphset :: Graph a (Set b) -> Set (a, b) Source #
converts a graph of sets to a set of pairs. The inverse is given by setgph.
Note
- This works also with infinite graphs of sets.
- It is not true that
setgphandgphsetare inverse in the strict sense, but almost, i.e. only in one restricts the graph to not empty associations. For exampleandGraph[(1,Set[]) ::GraphN(SetChar)both are mapped underGraph[] ::GraphN(SetChar)gphsetto.Set[] ::Set(N,Char)