Get Programming With Haskell by Will Kurt

Get Programming With Haskell by Will Kurt

Author:Will Kurt [Douglas Crockford]
Language: eng
Format: epub
ISBN: 1617293768
Amazon: 1617293768
Publisher: Manning Publications
Published: 2018-04-02T00:00:00+00:00


Now you can use this IO action in your main to modify your image file:

main :: IO () main = do args <- getArgs let fileName = head args imageFile <- BC.readFile fileName glitched <- randomReplaceByte imageFile let glitchedFileName = mconcat ["glitched_",fileName] BC.writeFile glitchedFileName glitched print "all done"

You can compile your program and run it at the command line:

$ ghc glitcher.hs $ ./glitcher lovecraft.jpg

These results are okay but not as dramatic as you’d hoped, as shown in figure 25.3.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.