Data.Functor.Compose
| Авторские права | (c) Ross Paterson 2010 |
|---|---|
| Лицензия | BSD-стиль (см. файл LICENSE) |
| Поддерживающий | libraries@haskell.org |
| Устойчивость | стабильная |
| Переносимость | переносимая |
| Safe Haskell | Надежная |
| Язык | Haskell2010 |
Описание
Составление функторов.
С версии: base-4.9.0.0
newtype Compose (f :: k -> Type) (g :: k1 -> k) (a :: k1) infixr 9 Исходный код
Композиция функторов справа налево. Композиция аппликативных функторов всегда аппликативна, но композиция монады не всегда является монадой.
Примеры
>>> fmap (subtract 1) (Compose (Just [1, 2, 3])) Compose (Just [0,1,2])
>>> Compose (Just [1, 2, 3]) <> Compose Nothing Compose (Just [1,2,3])
>>> Compose (Just [(++ "World"), (++ "Haskell")]) <*> Compose (Just ["Hello, "]) Compose (Just ["Hello, World","Hello, Haskell"])
Конструкторы
| Compose infixr 9 | |
Поля
| |
Примеры использования
| TestEquality f => TestEquality (Compose f g :: k2 -> Type) Source |
Дедукция (через генеративность), что если Since: base-4.14.0.0 |
||||
Определено в Data.Functor.Compose | |||||
| Functor f => Generic1 (Compose f g :: k -> Type) Source | |||||
Определено в Data.Functor.Compose Связанные типы
| |||||
| (Foldable1 f, Foldable1 g) => Foldable1 (Compose f g) Source | Since: base-4.18.0.0 |
||||
Определено в Data.Foldable1 Методыfold1 :: Semigroup m => Compose f g m -> m Source foldMap1 :: Semigroup m => (a -> m) -> Compose f g a -> m Source foldMap1' :: Semigroup m => (a -> m) -> Compose f g a -> m Source toNonEmpty :: Compose f g a -> NonEmpty a Source maximum :: Ord a => Compose f g a -> a Source minimum :: Ord a => Compose f g a -> a Source head :: Compose f g a -> a Source last :: Compose f g a -> a Source foldrMap1 :: (a -> b) -> (a -> b -> b) -> Compose f g a -> b Source foldlMap1' :: (a -> b) -> (b -> a -> b) -> Compose f g a -> b Source foldlMap1 :: (a -> b) -> (b -> a -> b) -> Compose f g a -> b Source foldrMap1' :: (a -> b) -> (a -> b -> b) -> Compose f g a -> b Source | |||||
| (Eq1 f, Eq1 g) => Eq1 (Compose f g) Source | Since: base-4.9.0.0 |
||||
| (Ord1 f, Ord1 g) => Ord1 (Compose f g) Source | Since: base-4.9.0.0 |
Defined in Data.Functor.Compose | |
| (Read1 f, Read1 g) => Read1 (Compose f g) Source | Since: base-4.9.0.0 |
Defined in Data.Functor.Compose МетодыliftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Compose f g a) Source liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Compose f g a] Source liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Compose f g a) Source liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Compose f g a] Source | |
| (Show1 f, Show1 g) => Show1 (Compose f g) Source | Since: base-4.9.0.0 |
| (Functor f, Contravariant g) => Contravariant (Compose f g) Source | |
| (Alternative f, Applicative g) => Alternative (Compose f g) Source | Since: base-4.9.0.0 |
| (Applicative f, Applicative g) => Applicative (Compose f g) Source | Since: base-4.9.0.0 |
Определено в Data.Functor.Compose Методыpure :: a -> Compose f g a Source (<*>) :: Compose f g (a -> b) -> Compose f g a -> Compose f g b Source liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c Source (*>) :: Compose f g a -> Compose f g b -> Compose f g b Source (<*) :: Compose f g a -> Compose f g b -> Compose f g a Source | |
| (Functor f, Functor g) => Functor (Compose f g) Source | С версии: base-4.9.0.0 |
| (Foldable f, Foldable g) => Foldable (Compose f g) Source | С версии: base-4.9.0.0 |
Определено в Data.Functor.Compose Методыfold :: Monoid m => Compose f g m -> m Source foldMap :: Monoid m => (a -> m) -> Compose f g a -> m Source foldMap' :: Monoid m => (a -> m) -> Compose f g a -> m Source foldr :: (a -> b -> b) -> b -> Compose f g a -> b Source foldr' :: (a -> b -> b) -> b -> Compose f g a -> b Source foldl :: (b -> a -> b) -> b -> Compose f g a -> b Source foldl' :: (b -> a -> b) -> b -> Compose f g a -> b Source foldr1 :: (a -> a -> a) -> Compose f g a -> a Source foldl1 :: (a -> a -> a) -> Compose f g a -> a Source toList :: Compose f g a -> [a] Source null :: Compose f g a -> Bool Source length :: Compose f g a -> Int Source elem :: Eq a => a -> Compose f g a -> Bool Source maximum :: Ord a => Compose f g a -> a Source minimum :: Ord a => Compose f g a -> a Source | |
Определено в Data.Functor.Compose Методыgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> Compose f g a -> c (Compose f g a) Source gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Compose f g a) Source toConstr :: Compose f g a -> Constr Source dataTypeOf :: Compose f g a -> DataType Source dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Compose f g a)) Source dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Compose f g a)) Source gmapT :: (forall b. Data b => b -> b) -> Compose f g a -> Compose f g a Source gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Compose f g a -> r Source gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Compose f g a -> r Source gmapQ :: (forall d. Data d => d -> u) -> Compose f g a -> [u] Source gmapQi :: Int -> (forall d. Data d => d -> u) -> Compose f g a -> u Source gmapM :: Monad m => (forall d. Data d => d -> m d) -> Compose f g a -> m (Compose f g a) Source gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Compose f g a -> m (Compose f g a) Source gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Compose f g a -> m (Compose f g a) Source | |
| Bounded (f (g a)) => Bounded (Compose f g a) Source | С версии: base-4.19.0.0 |
| Enum (f (g a)) => Enum (Compose f g a) Source | С версии: base-4.19.0.0 |
Определено в Data.Functor.Compose Методыsucc :: Compose f g a -> Compose f g a Исходный код pred :: Compose f g a -> Compose f g a Исходный код toEnum :: Целое -> Compose f g a Исходный код fromEnum :: Compose f g a -> Целое Исходный код enumFrom :: Compose f g a -> [Compose f g a] Исходный код enumFromThen :: Compose f g a -> Compose f g a -> [Compose f g a] Исходный код enumFromTo :: Compose f g a -> Compose f g a -> [Compose f g a] Исходный код enumFromThenTo :: Compose f g a -> Compose f g a -> Compose f g a -> [Compose f g a] Исходный код | |
| Floating (f (g a)) => Floating (Compose f g a) Исходный код | С момента: base-4.20.0.0 |
Определено в Data.Functor.Compose Методы(+) :: Compose f g a -> Compose f g a -> Compose f g a Исходный код (-) :: Compose f g a -> Compose f g a -> Compose f g a Исходный код (*) :: Compose f g a -> Compose f g a -> Compose f g a Исходный код negate :: Compose f g a -> Compose f g a Исходный код abs :: Compose f g a -> Compose f g a Исходный код signum :: Compose f g a -> Compose f g a Исходный код fromInteger :: Integer -> Compose f g a Исходный код | |
| Read (f (g a)) => Read (Compose f g a) Исходный код | С момента: base-4.18.0.0 |
Определено в Data.Functor.Compose МетодыreadsPrec :: Int -> ReadS (Compose f g a) Исходный код readList :: ReadS [Compose f g a] Исходный код readPrec :: ReadPrec (Compose f g a) Исходный код readListPrec :: ReadPrec [Compose f g a] Исходный код | |
| Fractional (f (g a)) => Fractional (Compose f g a) Исходный код | С момента: base-4.20.0.0 |
Определено в Data.Functor.Compose Методы(/) :: Compose f g a -> Compose f g a -> Compose f g a Исходный код recip :: Compose f g a -> Compose f g a Исходный код fromRational :: Rational -> Compose f g a Исходный код | |
| Integral (f (g a)) => Integral (Compose f g a) Исходный код | С момента: base-4.19.0.0 |
Определено в Data.Functor.Compose Методыquot :: Compose f g a -> Compose f g a -> Compose f g a Исходный код rem :: Compose f g a -> Compose f g a -> Compose f g a Исходный код div :: Compose f g a -> Compose f g a -> Compose f g a Исходный код mod :: Compose f g a -> Compose f g a -> Compose f g a Исходный код quotRem :: Compose f g a -> Compose f g a -> (Compose f g a, Compose f g a) Исходный код divMod :: Compose f g a -> Compose f g a -> (Compose f g a, Compose f g a) Исходный код toInteger :: Compose f g a -> Integer Исходный код | |
| Real (f (g a)) => Real (Compose f g a) Source | Since: base-4.19.0.0 |
Определено в Data.Functor.Compose МетодыtoRational :: Compose f g a -> Рациональное Source | |
| RealFrac (f (g a)) => RealFrac (Compose f g a) Source | Since: base-4.20.0.0 |
Определено в Data.Functor.Compose | |
| Show (f (g a)) => Show (Compose f g a) Source | Since: base-4.18.0.0 |
| Eq (f (g a)) => Eq (Compose f g a) Source | Since: base-4.18.0.0 |
| Ord (f (g a)) => Ord (Compose f g a) Source | Since: base-4.18.0.0 |
Определено в Data.Functor.Compose Методыcompare :: Compose f g a -> Compose f g a -> Порядок Source (<) :: Compose f g a -> Compose f g a -> Булево Source (<=) :: Compose f g a -> Compose f g a -> Булево Source (>) :: Compose f g a -> Compose f g a -> Булево Source (>=) :: Compose f g a -> Compose f g a -> Булево Source max :: Compose f g a -> Compose f g a -> Compose f g a Source min :: Compose f g a -> Compose f g a -> Compose f g a Source | |
| type Rep1 (Compose f g :: k -> Тип) Source | Since: base-4.9.0.0 |
Определено в Data.Functor.Compose | |
| type Rep (Compose f g a) Исходный код | С момента: base-4.9.0.0 |
Определено в Data.Functor.Compose | |
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.12.1/docs/libraries/base-4.21.0.0-8e62/Data-Functor-Compose.html