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

Control.Monad.Trans.Wedge

Description

This module contains utilities for the monad transformer for the pointed coproduct.

Synopsis

Monad transformer

newtype WedgeT a m b Source #

A monad transformer for the pointed product, parameterized by:

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

This monad transformer is similar to ExceptT, except with the possibility of an empty unital value.

Constructors

WedgeT 

Fields

Instances

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

Defined in Control.Monad.Trans.Wedge

(MonadWriter w m, Semigroup t) => MonadWriter w (WedgeT t m) Source # 
Instance details

Defined in Control.Monad.Trans.Wedge

Methods

writer :: (a, w) -> WedgeT t m a #

tell :: w -> WedgeT t m () #

listen :: WedgeT t m a -> WedgeT t m (a, w) #

pass :: WedgeT t m (a, w -> w) -> WedgeT t m a #

(MonadState s m, Semigroup t) => MonadState s (WedgeT t m) Source # 
Instance details

Defined in Control.Monad.Trans.Wedge

Methods

get :: WedgeT t m s #

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

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

(MonadReader r m, Semigroup t) => MonadReader r (WedgeT t m) Source # 
Instance details

Defined in Control.Monad.Trans.Wedge

Methods

ask :: WedgeT t m r #

local :: (r -> r) -> WedgeT t m a -> WedgeT t m a #

reader :: (r -> a) -> WedgeT t m a #

(MonadError e m, Semigroup e) => MonadError e (WedgeT e m) Source # 
Instance details

Defined in Control.Monad.Trans.Wedge

Methods

throwError :: e -> WedgeT e m a #

catchError :: WedgeT e m a -> (e -> WedgeT e m a) -> WedgeT e m a #

MonadTrans (WedgeT a) Source # 
Instance details

Defined in Control.Monad.Trans.Wedge

Methods

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

(Semigroup a, Monad m) => Monad (WedgeT a m) Source # 
Instance details

Defined in Control.Monad.Trans.Wedge

Methods

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

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

return :: a0 -> WedgeT a m a0 #

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

Defined in Control.Monad.Trans.Wedge

Methods

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

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

(Semigroup a, Applicative f) => Applicative (WedgeT a f) Source # 
Instance details

Defined in Control.Monad.Trans.Wedge

Methods

pure :: a0 -> WedgeT a f a0 #

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

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

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

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

Combinators

mapWedgeT :: (m (Wedge a b) -> n (Wedge c d)) -> WedgeT a m b -> WedgeT c n d Source #

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