-- | If the value has already been computed, return that, otherwise compute it!
ifNotDoneG :: Ord k => k -> (v -> a) -> Done k v a -> Done k v a
ifNotDoneG k ifDone action = do
    done <- getDone k
    case done of
        Just x  -> return $ ifDone x
        Nothing -> action

-- | See if a value has been computed already.
ifNotDoneG :: Ord k => k -> (v -> a) -> Done k v a -> Done k v a
ifNotDoneG k ifDone action = do
    done <- getDone k
    case done of
        Just x  -> return $ ifDone x
        Nothing -> action

-- | See if a value has been computed already.
ifNotDoneG k ifDone action = do
    done <- getDone k
    case done of
        Just x  -> return $ ifDone x
        Nothing -> action

-- | See if a value has been computed already.