progressCompletedness :: t -> Progress s t -> (Progress (Maybe (Either t (t,Maybe t)),s) t, Maybe (Either t (t,Maybe t)))
progressCompletedness startingTime = \case
    Skipped forest    -> (Skipped  $ fmap (fmap (\s -> (Just (Left startingTime),s))) forest
                         ,Just (Left startingTime)) 
    Started forest    -> (Started  $ fmap (fmap (\s -> (Nothing,s))) forest
                         ,Just (Right (startingTime,Nothing)))
    Finished timeline -> (Finished $ adapt (instants timeline)
                         ,Just (Right (startingTime,Just (extract timeline))))

-- | Forget that there is a plan, get the underlying monadic action.
progressCompletedness :: t -> Progress s t -> (Progress (Maybe (Either t (t,Maybe t)),s) t, Maybe (Either t (t,Maybe t)))
progressCompletedness startingTime = \case
    Skipped forest    -> (Skipped  $ fmap (fmap (\s -> (Just (Left startingTime),s))) forest
                         ,Just (Left startingTime)) 
    Started forest    -> (Started  $ fmap (fmap (\s -> (Nothing,s))) forest
                         ,Just (Right (startingTime,Nothing)))
    Finished timeline -> (Finished $ adapt (instants timeline)
                         ,Just (Right (startingTime,Just (extract timeline))))

-- | Forget that there is a plan, get the underlying monadic action.
progressCompletedness startingTime = \case
    Skipped forest    -> (Skipped  $ fmap (fmap (\s -> (Just (Left startingTime),s))) forest
                         ,Just (Left startingTime)) 
    Started forest    -> (Started  $ fmap (fmap (\s -> (Nothing,s))) forest
                         ,Just (Right (startingTime,Nothing)))
    Finished timeline -> (Finished $ adapt (instants timeline)
                         ,Just (Right (startingTime,Just (extract timeline))))

-- | Forget that there is a plan, get the underlying monadic action.