index-core-1.0.2: Indexed Types

Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.IMonad.Do

Contents

Description

This module rebinds do notation to work with restricted monads in conjunction with the RebindableSyntax extension. This module re-exports Control.IMonad, so it only requires the following minimum file header:

 {-# LANGUAGE RebindableSyntax #-}

 import Control.IMonad.Do
 import Prelude hiding (Monad(..))

The Prelude is reimported since RebindableSyntax also includes the NoImplicitPrelude extension, otherwise the Prelude's Monad bindings would conflict with these bindings.

Synopsis

Modules

Rebindings

return :: IMonad m => a -> m (a := i) i Source

return replaces return from Control.Monad.

(>>=) :: IMonad m => m (a := j) i -> (a -> m (b := k) j) -> m (b := k) i infixl 1 Source

(>>=) replaces (>>=) from Control.Monad.

(>>) :: IMonad m => m (a := j) i -> m (b := k) j -> m (b := k) i infixl 1 Source

(>>) replaces (>>) from Control.Monad.

fail :: String -> m (a := j) i Source

fail replaces fail from Control.Monad