Last active
November 23, 2017 21:22
-
-
Save nullren/e58bb0da3e6c82f8969c91296ea01898 to your computer and use it in GitHub Desktop.
Revisions
-
Renning Bruns revised this gist
Nov 23, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ module Main ( main ) where @@ -17,4 +17,4 @@ main = do rubric <- fmap head getArgs input <- readFile "/usr/share/dict/words" let ls = map (map toLower) $ lines input mapM_ putStrLn $ filter (wordscape rubric) ls -
Renning Bruns revised this gist
Nov 23, 2017 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,8 +14,7 @@ wordscape rubric word = contained contained = word' `isSubsequenceOf` rubric' main = do rubric <- fmap head getArgs input <- readFile "/usr/share/dict/words" let ls = map (map toLower) $ lines input mapM_ putStrLn $ filter (wordscape rubric) ls -
Renning Bruns created this gist
Nov 23, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ module Wordscapes ( wordscape ) where import System.Environment import Data.List import Data.Char wordscape rubric word = contained where word' = sort word rubric' = sort rubric contained = word' `isSubsequenceOf` rubric' main = do args <- getArgs let rubric = head args input <- getContents let ls = map (map toLower) $ lines input mapM_ putStrLn $ filter (wordscape rubric) ls