Copyright | © 2017 All rights reserved. |
---|---|

License | GPL-3 |

Maintainer | Evan Cofsky <evan@theunixman.com> |

Stability | experimental |

Portability | POSIX |

Safe Haskell | None |

Language | Haskell2010 |

- module IO.Base
- module Control.Concurrent.STM.TVar
- module Control.Concurrent.STM.TMVar
- module Control.Concurrent.STM.TBChan
- data IO a :: * -> *
- data STM a :: * -> *
- atomically :: MonadBase IO m => STM α -> m α
- newTVarIO :: MonadBase IO m => a -> m (TVar a)
- newTMVarIO :: MonadBase IO m => a -> m (TMVar a)
- newEmptyTMVarIO :: MonadBase IO m => m (TMVar a)
- newTBChanIO :: (MonadBase IO m, Integral l) => l -> m (TBChan a)
- newTBChan :: Integral l => l -> STM (TBChan a)

# Documentation

module IO.Base

module Control.Concurrent.STM.TVar

module Control.Concurrent.STM.TMVar

A value of type

is a computation which, when performed,
does some I/O before returning a value of type `IO`

a`a`

.

There is really only one way to "perform" an I/O action: bind it to
`Main.main`

in your program. When your program is run, the I/O will
be performed. It isn't possible to perform I/O from an arbitrary
function, unless that function is itself in the `IO`

monad and called
at some point, directly or indirectly, from `Main.main`

.

`IO`

is a monad, so `IO`

actions can be combined using either the do-notation
or the `>>`

and `>>=`

operations from the `Monad`

class.

Monad IO | |

Functor IO | |

MonadFix IO | |

MonadFail IO | |

Applicative IO | |

Alternative IO | |

MonadPlus IO | |

MonadIO IO | |

MonadThrow IO | |

MonadCatch IO | |

MonadMask IO | |

PrimMonad IO | |

PrimBase IO | |

Apply IO | |

Bind IO | |

Quasi IO | |

MonadBaseControl IO IO | |

MonadBase IO IO | |

MArray IOArray e IO | |

Monoid a => Monoid (IO a) | |

(~) * a () => PrintfType (IO a) | |

(~) * a () => HPrintfType (IO a) | |

type PrimState IO | |

type StM IO a | |

A monad supporting atomic memory transactions.

atomically :: MonadBase IO m => STM α -> m α Source #

`atomically`

lifted to `MonadBase`

`IO`

.

newTMVarIO :: MonadBase IO m => a -> m (TMVar a) Source #

`newTMVarIO`

at the top level, lifted.

newEmptyTMVarIO :: MonadBase IO m => m (TMVar a) Source #

`newTMVarIO`

at the top level, lifted.

newTBChanIO :: (MonadBase IO m, Integral l) => l -> m (TBChan a) Source #

`newTBChanIO`

at the top level, lifted, only with a saturated length.