by hedshodd · 4y ago · 0 comments
Simplest example, I have would be to read something from a file and apply some function `f :: String -> String` to the contents of the file, and return an IO String again. Let's say that overarching function is called readFileAndProcess, then it could be defined like
`readFileAndProcess :: (String-> String) -> String -> IO String`
`readFileAndProcess f fileName = putStrLn . f <=< (readFile fileName)`
No comments yet.