newEdge Type t c p = do (Digraph ns es) <- getType
                        let ks = keys es
                            newNode = Edge (newId ks) c (newId ks) p
                            newGraph = Digraph ns (M.insert (newId ks) newNode es)
                        putType newGraph
                        return $ newId ks -- thank you, lazyness
newEdge Type t c p = do (Digraph ns es) <- getType
                        let ks = keys es
                            newNode = Edge (newId ks) c (newId ks) p
                            newGraph = Digraph ns (M.insert (newId ks) newNode es)
                        putType newGraph
                        return $ newId ks -- thank you, lazyness
newEdge Type t c p = do (Digraph ns es) <- getType
                        let ks = keys es
                            newNode = Edge (newId ks) c (newId ks) p
                            newGraph = Digraph ns (M.insert (newId ks) newNode es)
                        putType newGraph
                        return $ newId ks -- thank you, lazyness