Lets say I have a function foo :: String -> IO String
that makes a request to a web service, downloads some data, parses it, and returns a string. I know that the web service will always return the same string, given the same request string, barring a lack of an internet connection of something of the sort. Is this enough information to "safely" use unsafePerformIO
and know that it will never cause problems? Or must I make sure of some other things as well?
Edit: the reason I am considering this is because I have a function deduce :: (String -> String) -> String
that will take an input function as a paramater and deduce some properties of the function by evaluating it with different paramaters. Now I want to deduce some properties of this web service but without unsafePerformIO
I will have to change deduce
substantially, including changing its type signature to deduce :: (String -> IO String) -> String
which means I need to change all the other functions I may want to deduce properties of as well.