Idris2/benchmark/benchmarks/spellcheck/spellcheck.idr
2021-06-28 13:48:37 +01:00

15 lines
362 B
Idris

import System.File
import Data.String
import Data.List
main : IO ()
main = do
putStrLn "input file: "
file<-getLine
Right tocheck<-readFile file
| Left err => putStrLn $show err
Right dict<-readFile "words"
| Left err => putStrLn $show err
let diff = filter (\s=>not $ s `elem` words dict) $ words tocheck
putStrLn $ show diff