folds-0.7.5: 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 # 
Instance details

Defined in Data.Fold.M1

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 # 
Instance details

Defined in Data.Fold.M1

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 #

Profunctor M1 Source # 
Instance details

Defined in Data.Fold.M1

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 => q b c -> M1 a b -> M1 a c #

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

Corepresentable M1 Source # 
Instance details

Defined in Data.Fold.M1

Associated Types

type Corep M1 :: Type -> Type #

Methods

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

Choice M1 Source # 
Instance details

Defined in Data.Fold.M1

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 # 
Instance details

Defined in Data.Fold.M1

Methods

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

Strong M1 Source # 
Instance details

Defined in Data.Fold.M1

Methods

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

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

Costrong M1 Source # 
Instance details

Defined in Data.Fold.M1

Methods

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

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

Scan M1 Source # 
Instance details

Defined in Data.Fold.M1

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 # 
Instance details

Defined in Data.Fold

Methods

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

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

Cosieve M1 FreeSemigroup Source # 
Instance details

Defined in Data.Fold.M1

Methods

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

Monad (M1 a) Source # 
Instance details

Defined in Data.Fold.M1

Methods

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

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

return :: a0 -> M1 a a0 #

fail :: String -> M1 a a0 #

Functor (M1 a) Source # 
Instance details

Defined in Data.Fold.M1

Methods

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

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

MonadFix (M1 a) Source # 
Instance details

Defined in Data.Fold.M1

Methods

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

Applicative (M1 a) Source # 
Instance details

Defined in Data.Fold.M1

Methods

pure :: a0 -> M1 a a0 #

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

liftA2 :: (a0 -> b -> c) -> M1 a a0 -> M1 a b -> M1 a c #

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

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

Distributive (M1 a) Source # 
Instance details

Defined in Data.Fold.M1

Methods

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

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

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

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

Representable (M1 a) Source # 
Instance details

Defined in Data.Fold.M1

Associated Types

type Rep (M1 a) :: Type #

Methods

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

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

MonadZip (M1 a) Source # 
Instance details

Defined in Data.Fold.M1

Methods

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

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

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

Apply (M1 a) Source # 
Instance details

Defined in Data.Fold.M1

Methods

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

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

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

liftF2 :: (a0 -> b -> c) -> M1 a a0 -> M1 a b -> M1 a c #

Pointed (M1 a) Source # 
Instance details

Defined in Data.Fold.M1

Methods

point :: a0 -> M1 a a0 #

Category M1 Source # 
Instance details

Defined in Data.Fold.M1

Methods

id :: M1 a a #

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

Semigroupoid M1 Source # 
Instance details

Defined in Data.Fold.M1

Methods

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

MonadReader (FreeSemigroup a) (M1 a) Source # 
Instance details

Defined in Data.Fold.M1

Methods

ask :: M1 a (FreeSemigroup a) #

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

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

type Corep M1 Source # 
Instance details

Defined in Data.Fold.M1

type Rep (M1 a) Source # 
Instance details

Defined in Data.Fold.M1

type Rep (M1 a) = FreeSemigroup a

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