This is a fairly noob question. Considering the following imaginary functions:
someCalculation :: String -> Maybe String
someCalculation = Just
main :: IO ()
main = getLine >>= someCalculation >>= putStrLn
What I want to do is to run a non-deterministic calculation on an
input string, then print the output. In this case, 2 different monads
are in use (Maybe & IO). Of course this wouldn't work due to incorrect typing.
What would be the right way to handle something like this in Haskell?
The someCalculation implementation is just a placeholder, but you get the idea...
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 53:59:17 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,448 |