check :: String -> String -> IO ()
check function str
    = do let ls = lines str
             -- filter out lines that start with whitespace. They're
             -- from things like:
             --     import M ( ...,
             --                ..., <function>, ...
             ls' = filter (not . all isSpace . take 1) ls
         ns <- mapM (parseLine function) ls'
         st <- execStateT (do mapM_ use ns
                              st <- get
                              when (Set.null (stSeen st)) $
                                  problem "No values found")
                          emptyState
         when (stHadAProblem st) exitFailure
check :: String -> String -> IO ()
check function str
    = do let ls = lines str
             -- filter out lines that start with whitespace. They're
             -- from things like:
             --     import M ( ...,
             --                ..., <function>, ...
             ls' = filter (not . all isSpace . take 1) ls
         ns <- mapM (parseLine function) ls'
         st <- execStateT (do mapM_ use ns
                              st <- get
                              when (Set.null (stSeen st)) $
                                  problem "No values found")
                          emptyState
         when (stHadAProblem st) exitFailure
check function str
    = do let ls = lines str
             -- filter out lines that start with whitespace. They're
             -- from things like:
             --     import M ( ...,
             --                ..., <function>, ...
             ls' = filter (not . all isSpace . take 1) ls
         ns <- mapM (parseLine function) ls'
         st <- execStateT (do mapM_ use ns
                              st <- get
                              when (Set.null (stSeen st)) $
                                  problem "No values found")
                          emptyState
         when (stHadAProblem st) exitFailure