Last active
October 5, 2015 10:27
-
-
Save gnab/2792907 to your computer and use it in GitHub Desktop.
Haskell stdin grep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Environment | |
import Data.List | |
main = do | |
args <- getArgs | |
case args of | |
[word] -> interact $ unlines . filter (isInfixOf word) . lines | |
_ -> putStrLn "No word to match against specified!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment