liblawless-0.26.0: Prelude based on protolude for GHC 8 and beyond.

Copyright© 2017 All rights reserved.
LicenseGPL-3
MaintainerEvan Cofsky <evan@theunixman.com>
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

IO.Base

Description

 

Synopsis

Documentation

data IO a :: * -> * #

A value of type IO a is a computation which, when performed, does some I/O before returning a value of type 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.

Instances

Monad IO

Since: 2.1

Methods

(>>=) :: IO a -> (a -> IO b) -> IO b #

(>>) :: IO a -> IO b -> IO b #

return :: a -> IO a #

fail :: String -> IO a #

Functor IO

Since: 2.1

Methods

fmap :: (a -> b) -> IO a -> IO b #

(<$) :: a -> IO b -> IO a #

MonadFix IO

Since: 2.1

Methods

mfix :: (a -> IO a) -> IO a #

MonadFail IO

Since: 4.9.0.0

Methods

fail :: String -> IO a #

Applicative IO

Since: 2.1

Methods

pure :: a -> IO a #

(<*>) :: IO (a -> b) -> IO a -> IO b #

liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c #

(*>) :: IO a -> IO b -> IO b #

(<*) :: IO a -> IO b -> IO a #

Alternative IO

Since: 4.9.0.0

Methods

empty :: IO a #

(<|>) :: IO a -> IO a -> IO a #

some :: IO a -> IO [a] #

many :: IO a -> IO [a] #

MonadPlus IO

Since: 4.9.0.0

Methods

mzero :: IO a #

mplus :: IO a -> IO a -> IO a #

MonadIO IO

Since: 4.9.0.0

Methods

liftIO :: IO a -> IO a #

MonadThrow IO 

Methods

throwM :: Exception e => e -> IO a #

MonadCatch IO 

Methods

catch :: Exception e => IO a -> (e -> IO a) -> IO a #

MonadMask IO 

Methods

mask :: ((forall a. IO a -> IO a) -> IO b) -> IO b #

uninterruptibleMask :: ((forall a. IO a -> IO a) -> IO b) -> IO b #

PrimMonad IO 

Associated Types

type PrimState (IO :: * -> *) :: * #

PrimBase IO 
Quasi IO 
MonadBaseControl IO IO 

Associated Types

type StM (IO :: * -> *) a :: * #

Methods

liftBaseWith :: (RunInBase IO IO -> IO a) -> IO a #

restoreM :: StM IO a -> IO a #

MonadBase IO IO 

Methods

liftBase :: IO α -> IO α #

Semigroup a => Semigroup (IO a)

Since: 4.10.0.0

Methods

(<>) :: IO a -> IO a -> IO a #

sconcat :: NonEmpty (IO a) -> IO a #

stimes :: Integral b => b -> IO a -> IO a #

Monoid a => Monoid (IO a)

Since: 4.9.0.0

Methods

mempty :: IO a #

mappend :: IO a -> IO a -> IO a #

mconcat :: [IO a] -> IO a #

type PrimState IO 
type StM IO a 
type StM IO a = a