smash-0.1.3: Combinators for Maybe types
Copyright(c) 2020-2021 Emily Pillmore
LicenseBSD-3-Clause
MaintainerEmily Pillmore <emilypi@cohomolo.gy>
StabilityExperimental
PortabilityNon-portable
Safe HaskellSafe
LanguageHaskell2010

Control.Monad.Trans.Smash

Description

This module contains utilities for the monad transformer for the smash product.

Synopsis

Monad transformer

data SmashT a m b Source #

A monad transformer for the smash product, parameterized by:

  • a - the value on the left
  • b - the value on the right
  • m - The monad over a pointed product (see: Smash).

Instances

Instances details
(Monoid t, MonadRWS r w s m) => MonadRWS r w s (SmashT t m) Source # 
Instance details

Defined in Control.Monad.Trans.Smash

(Monoid a, MonadWriter w m) => MonadWriter w (SmashT a m) Source # 
Instance details

Defined in Control.Monad.Trans.Smash

Methods

writer :: (a0, w) -> SmashT a m a0 #

tell :: w -> SmashT a m () #

listen :: SmashT a m a0 -> SmashT a m (a0, w) #

pass :: SmashT a m (a0, w -> w) -> SmashT a m a0 #

(Monoid t, MonadState s m) => MonadState s (SmashT t m) Source # 
Instance details

Defined in Control.Monad.Trans.Smash

Methods

get :: SmashT t m s #

put :: s -> SmashT t m () #

state :: (s -> (a, s)) -> SmashT t m a #

(Monoid a, MonadReader r m) => MonadReader r (SmashT a m) Source # 
Instance details

Defined in Control.Monad.Trans.Smash

Methods

ask :: SmashT a m r #

local :: (r -> r) -> SmashT a m a0 -> SmashT a m a0 #

reader :: (r -> a0) -> SmashT a m a0 #

Monoid a => MonadTrans (SmashT a) Source # 
Instance details

Defined in Control.Monad.Trans.Smash

Methods

lift :: Monad m => m a0 -> SmashT a m a0 #

(Monoid a, Monad m) => Monad (SmashT a m) Source # 
Instance details

Defined in Control.Monad.Trans.Smash

Methods

(>>=) :: SmashT a m a0 -> (a0 -> SmashT a m b) -> SmashT a m b #

(>>) :: SmashT a m a0 -> SmashT a m b -> SmashT a m b #

return :: a0 -> SmashT a m a0 #

Functor f => Functor (SmashT a f) Source # 
Instance details

Defined in Control.Monad.Trans.Smash

Methods

fmap :: (a0 -> b) -> SmashT a f a0 -> SmashT a f b #

(<$) :: a0 -> SmashT a f b -> SmashT a f a0 #

(Monoid a, Applicative f) => Applicative (SmashT a f) Source # 
Instance details

Defined in Control.Monad.Trans.Smash

Methods

pure :: a0 -> SmashT a f a0 #

(<*>) :: SmashT a f (a0 -> b) -> SmashT a f a0 -> SmashT a f b #

liftA2 :: (a0 -> b -> c) -> SmashT a f a0 -> SmashT a f b -> SmashT a f c #

(*>) :: SmashT a f a0 -> SmashT a f b -> SmashT a f b #

(<*) :: SmashT a f a0 -> SmashT a f b -> SmashT a f a0 #

Combinators

mapSmashT :: (m (Smash a b) -> n (Smash c d)) -> SmashT a m b -> SmashT c n d Source #

Map both the left and right values and output of a computation using the given function.