processFiles :: ProcessingData -> ApiResponse String
processFiles (Just user, groups, FileList uFiles gFiles, opts, time, tz) = 
    processor <$> files
    where opts' = convertOptions opts
          files = (unpack . mconcat . mconcat) <$>
              ((:) <$> matchFiles (iUserFiles user) uFiles <*>
               (matchGroups groups gFiles >>= mapM (uncurry matchFiles)))
          processor = case opts of
                        SAgendaOptions{} -> A.getAgenda opts' tz time
                        SOutlineOptions{} -> O.getOutline opts'
processFiles :: ProcessingData -> ApiResponse String
processFiles (Just user, groups, FileList uFiles gFiles, opts, time, tz) = 
    processor <$> files
    where opts' = convertOptions opts
          files = (unpack . mconcat . mconcat) <$>
              ((:) <$> matchFiles (iUserFiles user) uFiles <*>
               (matchGroups groups gFiles >>= mapM (uncurry matchFiles)))
          processor = case opts of
                        SAgendaOptions{} -> A.getAgenda opts' tz time
                        SOutlineOptions{} -> O.getOutline opts'
processFiles (Just user, groups, FileList uFiles gFiles, opts, time, tz) = 
    processor <$> files
    where opts' = convertOptions opts
          files = (unpack . mconcat . mconcat) <$>
              ((:) <$> matchFiles (iUserFiles user) uFiles <*>
               (matchGroups groups gFiles >>= mapM (uncurry matchFiles)))
          processor = case opts of
                        SAgendaOptions{} -> A.getAgenda opts' tz time
                        SOutlineOptions{} -> O.getOutline opts'