Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype AdjacencyMap a = AM (MapC a (Set a))
- data Empty :: Exp (AdjacencyMap a)
- data Vertex :: a -> Exp (AdjacencyMap a)
- data Edge :: a -> a -> Exp (AdjacencyMap a)
- data Overlay :: AdjacencyMap a -> AdjacencyMap a -> Exp (AdjacencyMap a)
- data Connect :: AdjacencyMap a -> AdjacencyMap a -> Exp (AdjacencyMap a)
- data IsEmpty :: AdjacencyMap a -> Exp Bool
- data HasVertex :: a -> AdjacencyMap a -> Exp Bool
- data HasEdge :: a -> a -> AdjacencyMap a -> Exp Bool
- data VertexCount :: AdjacencyMap a -> Exp Nat
- data EdgeCount :: AdjacencyMap a -> Exp Nat
- data VertexList :: AdjacencyMap a -> Exp [a]
- data EdgeList :: AdjacencyMap a -> Exp [(a, a)]
- data EComb :: [(x, [y])] -> Exp [(x, y)]
- data VertexSet :: AdjacencyMap a -> Exp (Set a)
- data EdgeSet :: AdjacencyMap a -> Exp (Set (a, a))
- data AdjacencyList :: AdjacencyMap a -> Exp [(a, [a])]
- data UnionWith :: (v -> v -> Exp v) -> MapC k v -> MapC k v -> Exp (MapC k v)
- data UCombW :: (v -> v -> Exp v) -> (k, v) -> MapC k v -> Exp (MapC k v)
- data UnionsWith :: (v -> v -> Exp v) -> [MapC k v] -> Exp (MapC k v)
- data FromSet :: (k -> Exp a) -> Set k -> Exp (MapC k a)
- data ToFst :: (a -> Exp b) -> a -> Exp (b, a)
- data ToSnd :: (a -> Exp b) -> a -> Exp (a, b)
- data KeysSet :: MapC k a -> Exp (Set k)
Documentation
newtype AdjacencyMap a Source #
Instances
type Eval (Empty :: AdjacencyMap a -> Type) Source # | |
type Eval (Vertex a2 :: AdjacencyMap a1 -> Type) Source # | |
type Eval (ToAdjacencyMap x :: AdjacencyMap a -> Type) Source # | |
Defined in Fcf.Data.Graph type Eval (ToAdjacencyMap x :: AdjacencyMap a -> Type) = Eval (FoldG (Empty :: AdjacencyMap a -> Type) (Vertex :: a -> AdjacencyMap a -> Type) (Overlay :: AdjacencyMap a -> AdjacencyMap a -> AdjacencyMap a -> Type) (Connect :: AdjacencyMap a -> AdjacencyMap a -> AdjacencyMap a -> Type) x) | |
type Eval (Edge x y :: AdjacencyMap a -> Type) Source # | |
type Eval (Overlay ('AM x) ('AM y) :: AdjacencyMap a -> Type) Source # | |
type Eval (Connect ('AM x) ('AM y) :: AdjacencyMap a -> Type) Source # | |
data Empty :: Exp (AdjacencyMap a) Source #
Empty
Example
>>>
:kind! (Eval Empty :: AdjacencyMap Nat)
(Eval Empty :: AdjacencyMap Nat) :: AdjacencyMap Nat = 'AM ('MapC '[])
data Vertex :: a -> Exp (AdjacencyMap a) Source #
Vertex
Example
>>>
:kind! (Eval (Vertex 1) :: AdjacencyMap Nat)
(Eval (Vertex 1) :: AdjacencyMap Nat) :: AdjacencyMap Nat = 'AM ('MapC '[ '(1, 'S.Set '[])])
data Edge :: a -> a -> Exp (AdjacencyMap a) Source #
Edge
Example
>>>
:kind! (Eval (Edge 1 2) :: AdjacencyMap Nat)
(Eval (Edge 1 2) :: AdjacencyMap Nat) :: AdjacencyMap Nat = 'AM ('MapC '[ '(1, 'S.Set '[2]), '(2, 'S.Set '[])])
data Overlay :: AdjacencyMap a -> AdjacencyMap a -> Exp (AdjacencyMap a) Source #
Overlay
Example
>>>
:kind! (Eval (Overlay (Eval (Vertex 1)) (Eval (Vertex 2))))
(Eval (Overlay (Eval (Vertex 1)) (Eval (Vertex 2)))) :: AdjacencyMap Nat = 'AM ('MapC '[ '(2, 'S.Set '[]), '(1, 'S.Set '[])])
data Connect :: AdjacencyMap a -> AdjacencyMap a -> Exp (AdjacencyMap a) Source #
Connect
Example
>>>
:kind! (Eval (Connect (Eval (Vertex 1)) (Eval (Vertex 2))))
(Eval (Connect (Eval (Vertex 1)) (Eval (Vertex 2)))) :: AdjacencyMap Nat = 'AM ('MapC '[ '(1, 'S.Set '[2]), '(2, 'S.Set '[])])
data IsEmpty :: AdjacencyMap a -> Exp Bool Source #
IsEmpty
Example
>>>
:kind! (Eval (IsEmpty ('AM ('MapC '[]))))
(Eval (IsEmpty ('AM ('MapC '[])))) :: Bool = 'True
data HasVertex :: a -> AdjacencyMap a -> Exp Bool Source #
HasVertex
Example
>>>
:kind! (Eval (HasVertex 1 (Eval (Vertex 1))))
(Eval (HasVertex 1 (Eval (Vertex 1)))) :: Bool = 'True
data HasEdge :: a -> a -> AdjacencyMap a -> Exp Bool Source #
HasEdge
Example
>>>
:kind! (Eval (HasEdge 1 2 (Eval (Edge 1 2))))
(Eval (HasEdge 1 2 (Eval (Edge 1 2)))) :: Bool = 'True
data VertexCount :: AdjacencyMap a -> Exp Nat Source #
VertexCount
Example
>>>
:kind! (Eval (VertexCount (Eval (Edge 1 2))))
(Eval (VertexCount (Eval (Edge 1 2)))) :: Nat = 2
Instances
type Eval (VertexCount ('AM x) :: Nat -> Type) Source # | |
Defined in Fcf.Data.AdjacencyMap |
data EdgeCount :: AdjacencyMap a -> Exp Nat Source #
EdgeCount
Example
>>>
:kind! (Eval (EdgeCount (Eval (Edge 1 2))))
(Eval (EdgeCount (Eval (Edge 1 2)))) :: Nat = 1
data VertexList :: AdjacencyMap a -> Exp [a] Source #
VertexList
Example
>>>
:kind! (Eval (VertexList (Eval (Edge 1 2))))
(Eval (VertexList (Eval (Edge 1 2)))) :: [Nat] = '[1, 2]
Instances
type Eval (VertexList ('AM x) :: [k] -> Type) Source # | |
Defined in Fcf.Data.AdjacencyMap |
data EdgeList :: AdjacencyMap a -> Exp [(a, a)] Source #
EdgeList
Example
>>>
:kind! (Eval (EdgeList (Eval (Connect (Eval (Vertex 1)) (Eval (Connect (Eval (Vertex 2)) (Eval (Vertex 3))))))))
(Eval (EdgeList (Eval (Connect (Eval (Vertex 1)) (Eval (Connect (Eval (Vertex 2)) (Eval (Vertex 3)))))))) :: [(Nat, Nat)] = '[ '(1, 2), '(1, 3), '(2, 3)]
data VertexSet :: AdjacencyMap a -> Exp (Set a) Source #
VertexSet
Example
>>>
:kind! (Eval (VertexSet (Eval (Edge 1 2))))
(Eval (VertexSet (Eval (Edge 1 2)))) :: S.Set Nat = 'S.Set '[1, 2]
data EdgeSet :: AdjacencyMap a -> Exp (Set (a, a)) Source #
EdgeSet
Example
>>>
:kind! (Eval (EdgeSet (Eval (Edge 1 2))))
(Eval (EdgeSet (Eval (Edge 1 2)))) :: S.Set (Nat, Nat) = 'S.Set '[ '(1, 2)]
data AdjacencyList :: AdjacencyMap a -> Exp [(a, [a])] Source #
AdjacencyList
Example
>>>
:kind! (Eval (AdjacencyList (Eval (Edge 1 2))))
(Eval (AdjacencyList (Eval (Edge 1 2)))) :: [(Nat, [Nat])] = '[ '(1, '[2]), '(2, '[])]
Instances
data UnionWith :: (v -> v -> Exp v) -> MapC k v -> MapC k v -> Exp (MapC k v) Source #
UnionWith
Example
>>>
:kind! (Eval (UnionWith (++) (Eval (MapC.FromList ['(5, '["a"]), '(3, '["b"])])) (Eval (MapC.FromList ['(5, '["A"]), '(7, '["C"])]))))
(Eval (UnionWith (++) (Eval (MapC.FromList ['(5, '["a"]), '(3, '["b"])])) (Eval (MapC.FromList ['(5, '["A"]), '(7, '["C"])])))) :: MapC Nat [Symbol] = 'MapC '[ '(5, '["a", "A"]), '(7, '["C"]), '(3, '["b"])]
data UnionsWith :: (v -> v -> Exp v) -> [MapC k v] -> Exp (MapC k v) Source #
UnionsWith
Example
>>>
:kind! (Eval (UnionsWith (++) ['MapC ['(5, '["a"]), '(3, '["b"])], 'MapC ['(5, '["A"]), '(7, '["C"])], 'MapC ['(5, '["e"]), '(7, '["o"])]]))
(Eval (UnionsWith (++) ['MapC ['(5, '["a"]), '(3, '["b"])], 'MapC ['(5, '["A"]), '(7, '["C"])], 'MapC ['(5, '["e"]), '(7, '["o"])]])) :: MapC Nat [Symbol] = 'MapC '[ '(7, '["C", "o"]), '(5, '["a", "A", "e"]), '(3, '["b"])]
data FromSet :: (k -> Exp a) -> Set k -> Exp (MapC k a) Source #
FromSet
Example
>>>
:kind! (Eval (FromSet ((+) 1) ('S.Set [1,2,3])))
(Eval (FromSet ((+) 1) ('S.Set [1,2,3]))) :: MapC Nat Nat = 'MapC '[ '(1, 2), '(2, 3), '(3, 4)]
data ToFst :: (a -> Exp b) -> a -> Exp (b, a) Source #
ToFst
Example
>>>
:kind! (Eval (ToFst Length ["f", "o", "o"]))
(Eval (ToFst Length ["f", "o", "o"])) :: (Nat, [Symbol]) = '(3, '["f", "o", "o"])
data ToSnd :: (a -> Exp b) -> a -> Exp (a, b) Source #
ToSnd
Example
>>>
:kind! (Eval (ToSnd Length ["f", "o", "o"]))
(Eval (ToSnd Length ["f", "o", "o"])) :: ([Symbol], Nat) = '( '["f", "o", "o"], 3)