summaryrefslogtreecommitdiff
path: root/src/Grasp/Types/GEdge.hs
blob: 38ce5969495937070070c1d899e257f804b7d43f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
module Grasp.Types.GEdge (
	GEdge,

	mk,

	toSrc,
	toDest,
	toLabel,
	toLEdge
	) where




import Grasp.Graph( Node, LEdge )
import Grasp.Types.EdgeLabel( EdgeLabel )




newtype GEdge = GEdge (LEdge EdgeLabel)
    deriving (Show, Eq)




mk :: LEdge EdgeLabel -> GEdge
mk = GEdge

toSrc :: GEdge -> Node
toSrc (GEdge (x,_,_)) = x

toDest :: GEdge -> Node
toDest (GEdge (_,y,_)) = y

toLabel :: GEdge -> EdgeLabel
toLabel (GEdge (_,_,z)) = z

toLEdge :: GEdge -> LEdge EdgeLabel
toLEdge (GEdge e) = e