folds-0.7.4: Beautiful Folding

Safe HaskellTrustworthy
LanguageHaskell98

Data.Fold.M1

Synopsis

Documentation

data M1 a b Source #

A semigroup reducer

Constructors

M1 (m -> b) (a -> m) (m -> m -> m) 

Instances

Arrow M1 Source # 

Methods

arr :: (b -> c) -> M1 b c #

first :: M1 b c -> M1 (b, d) (c, d) #

second :: M1 b c -> M1 (d, b) (d, c) #

(***) :: M1 b c -> M1 b' c' -> M1 (b, b') (c, c') #

(&&&) :: M1 b c -> M1 b c' -> M1 b (c, c') #

ArrowChoice M1 Source # 

Methods

left :: M1 b c -> M1 (Either b d) (Either c d) #

right :: M1 b c -> M1 (Either d b) (Either d c) #

(+++) :: M1 b c -> M1 b' c' -> M1 (Either b b') (Either c c') #

(|||) :: M1 b d -> M1 c d -> M1 (Either b c) d #

Corepresentable M1 Source # 

Associated Types

type Corep (M1 :: * -> * -> *) :: * -> * #

Methods

cotabulate :: (Corep M1 d -> c) -> M1 d c #

Profunctor M1 Source # 

Methods

dimap :: (a -> b) -> (c -> d) -> M1 b c -> M1 a d #

lmap :: (a -> b) -> M1 b c -> M1 a c #

rmap :: (b -> c) -> M1 a b -> M1 a c #

(#.) :: Coercible * c b => (b -> c) -> M1 a b -> M1 a c #

(.#) :: Coercible * b a => M1 b c -> (a -> b) -> M1 a c #

Choice M1 Source # 

Methods

left' :: M1 a b -> M1 (Either a c) (Either b c) #

right' :: M1 a b -> M1 (Either c a) (Either c b) #

Closed M1 Source # 

Methods

closed :: M1 a b -> M1 (x -> a) (x -> b) #

Strong M1 Source # 

Methods

first' :: M1 a b -> M1 (a, c) (b, c) #

second' :: M1 a b -> M1 (c, a) (c, b) #

Costrong M1 Source # 

Methods

unfirst :: M1 (a, d) (b, d) -> M1 a b #

unsecond :: M1 (d, a) (d, b) -> M1 a b #

Scan M1 Source # 

Methods

prefix1 :: a -> M1 a b -> M1 a b Source #

postfix1 :: M1 a b -> a -> M1 a b Source #

run1 :: a -> M1 a b -> b Source #

interspersing :: a -> M1 a b -> M1 a b Source #

AsRM1 M1 Source # 

Methods

asM1 :: M1 a b -> M1 a b Source #

asR1 :: M1 a b -> R1 a b Source #

Cosieve M1 FreeSemigroup Source # 

Methods

cosieve :: M1 a b -> FreeSemigroup a -> b #

Monad (M1 a) Source # 

Methods

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

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

return :: a -> M1 a a #

fail :: String -> M1 a a #

Functor (M1 a) Source # 

Methods

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

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

MonadFix (M1 a) Source # 

Methods

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

Applicative (M1 a) Source # 

Methods

pure :: a -> M1 a a #

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

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

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

Distributive (M1 a) Source # 

Methods

distribute :: Functor f => f (M1 a a) -> M1 a (f a) #

collect :: Functor f => (a -> M1 a b) -> f a -> M1 a (f b) #

distributeM :: Monad m => m (M1 a a) -> M1 a (m a) #

collectM :: Monad m => (a -> M1 a b) -> m a -> M1 a (m b) #

Representable (M1 a) Source # 

Associated Types

type Rep (M1 a :: * -> *) :: * #

Methods

tabulate :: (Rep (M1 a) -> a) -> M1 a a #

index :: M1 a a -> Rep (M1 a) -> a #

MonadZip (M1 a) Source # 

Methods

mzip :: M1 a a -> M1 a b -> M1 a (a, b) #

mzipWith :: (a -> b -> c) -> M1 a a -> M1 a b -> M1 a c #

munzip :: M1 a (a, b) -> (M1 a a, M1 a b) #

Pointed (M1 a) Source # 

Methods

point :: a -> M1 a a #

Apply (M1 a) Source # 

Methods

(<.>) :: M1 a (a -> b) -> M1 a a -> M1 a b #

(.>) :: M1 a a -> M1 a b -> M1 a b #

(<.) :: M1 a a -> M1 a b -> M1 a a #

Category * M1 Source # 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

Semigroupoid * M1 Source # 

Methods

o :: c j k1 -> c i j -> c i k1 #

MonadReader (FreeSemigroup a) (M1 a) Source # 

Methods

ask :: M1 a (FreeSemigroup a) #

local :: (FreeSemigroup a -> FreeSemigroup a) -> M1 a a -> M1 a a #

reader :: (FreeSemigroup a -> a) -> M1 a a #

type Corep M1 Source # 
type Rep (M1 a) Source # 
type Rep (M1 a) = FreeSemigroup a

runM1 :: Foldable1 f => f a -> M1 a b -> b Source #