edge :: Eq a => Coroutine a (Event a)
edge = Coroutine $ \i -> ([i], Just $ step i) where
    step old = Coroutine $ \i ->
        if old == i
            then ([],  Just $ step i)
            else ([i], Just $ step i)
edge :: Eq a => Coroutine a (Event a)
edge = Coroutine $ \i -> ([i], Just $ step i) where
    step old = Coroutine $ \i ->
        if old == i
            then ([],  Just $ step i)
            else ([i], Just $ step i)
edge = Coroutine $ \i -> ([i], Just $ step i) where
    step old = Coroutine $ \i ->
        if old == i
            then ([],  Just $ step i)
            else ([i], Just $ step i)