-- | Finds anagrams
-- If words are given on the command-line anagrams are found for these
-- words, printed to stdout and then the program exits. Otherwise
-- the program will run in interactive mode continually prompting
-- for new words to find anagrams for until the program is interrupted.
main :: IO ()
main = do
    params <- execParser options
    ana  <- anagrams <$> (getWords . dictFile) params >>= evaluate . force
    case words params of
        [] -> forever $ interactive ana
        xs -> xs `forM_` \ x -> printResult x (ana x)
main :: IO ()
main = do
    params <- execParser options
    ana  <- anagrams <$> (getWords . dictFile) params >>= evaluate . force
    case words params of
        [] -> forever $ interactive ana
        xs -> xs `forM_` \ x -> printResult x (ana x)
main = do
    params <- execParser options
    ana  <- anagrams <$> (getWords . dictFile) params >>= evaluate . force
    case words params of
        [] -> forever $ interactive ana
        xs -> xs `forM_` \ x -> printResult x (ana x)