act (Delete word) = do fp <- todofile fh <- openFile fp ReadMode fc <- hGetContents fh let content = unlines $ filter (not.isInfixOf word) (lines fc) --print content hClose fh fh <- openFile fp WriteMode hPutStr fh content hClose fh