wordsearch-1.0.1: Main.hs
{-# LANGUAGE TemplateHaskell #-}
import Data.Record.Label
import qualified Data.Set as S
import Text.WordSearchSolver
main :: IO ()
main = interact conv
where conv s = let ~(Just ws) = readWordSearch s
(matches, nonmatches) = solveWordSearch ws
in (++ "\n" ++ (unlines . S.toList . searchToSet $ nonmatches)) . showGridInsert '\n' . fillMatches '_' (getL (ws_grid) $ ws) $ matches