Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Control/Monad/Indexed/Syntax.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module Control.Monad.Indexed.Syntax where

import Control.Monad.Indexed

import Prelude hiding ((=<<), (>>=), (>>))

(<$>) :: IxFunctor f => (a -> b) -> f j k a -> f j k b
(<$>) = imap

(<*>) :: IxApplicative f => f i j (a -> b) -> f j k a -> f i k b
(<*>) = iap

(=<<) :: IxMonad m => (a -> m j k b) -> m i j a -> m i k b
(=<<) = ibind

(>>=) :: IxMonad m => m i j a -> (a -> m j k b) -> m i k b
(>>=) = flip (=<<)

(>>) :: IxMonad m => m i j a -> m j k b -> m i k b
a >> b = a >>= const b
3 changes: 2 additions & 1 deletion indexed.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ source-repository head
Library
Exposed-modules:
Data.Functor.Indexed,
Control.Monad.Indexed,
Control.Monad.Indexed,
Control.Monad.Indexed.Fix,
Control.Monad.Indexed.Syntax,
Control.Monad.Indexed.Trans
Control.Comonad.Indexed
default-language: Haskell98
Expand Down