- = case f v of
- Nothing = Nothing
- Just t = Just (Embedded, \stl->
- get (sdsFocus {onlyIndex=Nothing,onlyTaskId=Nothing,onlySelf=False,includeValue=False,includeProgress=False,includeAttributes=False} stl)
- removeTask taskId stl
- >-| t @ Right)
+ = add <$> f v
+
+ add t = (Embedded, \stl->
+ get (sdsFocus {onlyIndex=Nothing,onlyTaskId=Nothing,onlySelf=False,includeValue=False,includeProgress=False,includeAttributes=False} stl)
+ >>- \(_, pts)->case pts of
+ [tli:_] = removeTask tli.TaskListItem.taskId stl
+ >-| t @ Right
+ _ = abort "shouldn't happen"
+ )