Idris2/benchmark/benchmarks/spellcheck/spellcheck.idr

15 lines
362 B
Idris
Raw Normal View History

2021-01-12 16:22:58 +03:00
import System.File
import Data.String
2021-01-12 16:22:58 +03:00
import Data.List
main : IO ()
2021-01-16 17:26:55 +03:00
main = do
2021-01-12 16:22:58 +03:00
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