@@ -397,7 +397,7 @@ updateTrackedNotes newNotes = do
397397cmdNewNote :: MonadStorage m => New -> Day -> m (EntityDoc Note )
398398cmdNewNote New {text, start, end, isWiki, tags} today = do
399399 let start' = fromMaybe today start
400- whenJust end $ assertStartBeforeEnd start'
400+ for_ end $ assertStartBeforeEnd start'
401401 (status, note_end, noteStart) <-
402402 case end of
403403 _ | not isWiki -> pure (TaskStatus Active , end, start')
@@ -504,7 +504,7 @@ cmdEdit edit input = case edit of
504504 fmap toList . for ids $ \ nid ->
505505 modifyAndView nid $ do
506506 -- check text editability
507- whenJust text $ const assertNoteIsNative
507+ for_ text $ const assertNoteIsNative
508508 -- check start and end editability
509509 when (isJust start || isJust end) $ do
510510 status <- note_status_read
@@ -519,14 +519,14 @@ cmdEdit edit input = case edit of
519519 <$> (start <|> curStart)
520520 <*> (end' <|> curEnd)
521521 end' = end >>= assignToMaybe
522- whenJust newStartEnd $
522+ for_ newStartEnd $
523523 uncurry assertStartBeforeEnd
524524 -- update
525- whenJust end $ \ case
525+ for_ end $ \ case
526526 Clear -> note_end_clear
527527 Set e -> note_end_set e
528- whenJust start note_start_set
529- whenJust text $ note_text_zoom . RGA. editText
528+ for_ start note_start_set
529+ for_ text $ note_text_zoom . RGA. editText
530530 -- add new tags
531531 unless (null addTags) $ do
532532 currentRefs <- HashSet. fromList <$> note_tags_read
@@ -580,7 +580,7 @@ note_status_setIfDiffer newStatus = do
580580assertNoteIsNative :: (MonadE m , MonadObjectState Note m ) => m ()
581581assertNoteIsNative = do
582582 tracking <- note_track_read
583- whenJust tracking $ \ Track {track_url} ->
583+ for_ tracking $ \ Track {track_url} ->
584584 throwErrorText $
585585 " A tracked note must be edited in its source"
586586 <> maybe " " (" :" <> ) track_url
@@ -606,11 +606,6 @@ noDataDirectoryMessage :: String
606606noDataDirectoryMessage =
607607 " Data directory isn't set, run `ff config dataDir --help`"
608608
609- whenJust :: Applicative m => Maybe a -> (a -> m () ) -> m ()
610- whenJust m f = case m of
611- Nothing -> pure ()
612- Just x -> f x
613-
614609sponsors :: [Text ]
615610sponsors = [" Alexander Granin" , " Nadezda" ]
616611
0 commit comments