Any of those help I seem to miss something fundamental. ,

code :

```
map :: (a -> b) -> [a] -> [b]
```

```
join :: (Start, [End]) -> [Edge]
```

```
map join :: [(Start, [End])] -> [[Edge]]
```

```
type Node = Integer
type Edge = (Node, Node)
type Start = Node
type End = Node
newtype Graph = Graph {
edges :: [(Start, [End])]
} deriving (Eq, Show)
join :: (Start, [End]) -> [Edge]
join (start, ends) = map (\e -> if start < e then (start, e) else (e, start)) ends
sampleGraph =
Graph [(5, [1, 2, 3]),
(7, [1, 2]),
(1, [1, 2]),
(2, [1, 2])
]
foo = map join . edges
```

```
case sampleGraph of
Graph edges -> map join edges
```