otherNode :: Node a -> Edge -> NodeId
otherNode n e
    | n^.nodeId == e^.left  = e^.right
    | n^.nodeId == e^.right = e^.left
    | otherwise     = error "invalid state"
otherNode :: Node a -> Edge -> NodeId
otherNode n e
    | n^.nodeId == e^.left  = e^.right
    | n^.nodeId == e^.right = e^.left
    | otherwise     = error "invalid state"
otherNode n e
    | n^.nodeId == e^.left  = e^.right
    | n^.nodeId == e^.right = e^.left
    | otherwise     = error "invalid state"