--MCP import System.Environment (getArgs) import Input (input) import CircularShift (circularShift) import Alphabetize (alphabetize) import Output (output) main :: IO () main = getArgs >>= parseArgs parseArgs :: [FilePath] -> IO () parseArgs [fname] = kwic fname parseArgs _ = error "expects a single file name argument" kwic :: FilePath -> IO () {- kwic fname = do a <- input fname allShifts <- circularShift a sortedShifts <- alphabetize allShifts output sortedShifts -} -- can also be written more as a 'pipe' via kwic fname = input fname >>= circularShift >>= alphabetize >>= output