-- $Id: spellcheck.ghc,v 1.1 2001/03/02 15:46:08 doug Exp $ -- http://www.bagley.org/~doug/shootout/ -- from Julian Assange -- compile with: ghc -O -package data module Main(main) where import FiniteMap(addToFM_C,emptyFM,elemFM) addFM fm [] = fm addFM fm (x:xs) = addFM (addToFM_C (\_ _ -> ()) fm x ()) xs main = do d <- readFile "Usr.Dict.Words" interact $ unlines . filter (\x -> not $ elemFM x (addFM emptyFM (lines d))) . lines