Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Another way to make FreeT
an instance of FMonad
FreeT
can be FMonad
in two different ways. There is already an instance:
instance Functor f => FMonad (FreeT f) where fpure :: Functor m => m ~> FreeT f m fbind :: (Functor m, Functor n) => (m ~> FreeT f n) -> (FreeT f m ~> FreeT f n)
In addition to this standard instance, FreeT f m
have FMonad
-like structure by treating
f
as the parameter while fixing m
to some arbitrary Monad
.
fpureFst
:: (Monad m) => (Functor f) => f ~> FreeT f mfbindFst
:: (Monad m) => (Functor f, Functor g) => (f ~> FreeT g m) -> (FreeT f m ~> FreeT g m)
This module provides a newtype wrapper FreeT'
to use these as a real FMonad
instance.
Documentation
FreeT'
is a FreeT
, but with the order of its arguments flipped.
FreeT' m f a ≡ FreeT f m a
WrapFreeT' | |
|
Instances
Functor m => FFunctor (FreeT' m) Source # | |
Monad m => FMonad (FreeT' m) Source # | |
(Foldable m, Foldable f) => Foldable (FreeT' m f) Source # | |
Defined in FMonad.FreeT fold :: Monoid m0 => FreeT' m f m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> FreeT' m f a -> m0 # foldMap' :: Monoid m0 => (a -> m0) -> FreeT' m f a -> m0 # foldr :: (a -> b -> b) -> b -> FreeT' m f a -> b # foldr' :: (a -> b -> b) -> b -> FreeT' m f a -> b # foldl :: (b -> a -> b) -> b -> FreeT' m f a -> b # foldl' :: (b -> a -> b) -> b -> FreeT' m f a -> b # foldr1 :: (a -> a -> a) -> FreeT' m f a -> a # foldl1 :: (a -> a -> a) -> FreeT' m f a -> a # toList :: FreeT' m f a -> [a] # null :: FreeT' m f a -> Bool # length :: FreeT' m f a -> Int # elem :: Eq a => a -> FreeT' m f a -> Bool # maximum :: Ord a => FreeT' m f a -> a # minimum :: Ord a => FreeT' m f a -> a # | |
(Eq1 f, Eq1 m) => Eq1 (FreeT' m f) Source # | |
(Ord1 f, Ord1 m) => Ord1 (FreeT' m f) Source # | |
Defined in FMonad.FreeT | |
(Read1 f, Read1 m) => Read1 (FreeT' m f) Source # | |
Defined in FMonad.FreeT | |
(Show1 f, Show1 m) => Show1 (FreeT' m f) Source # | |
(Traversable f, Traversable m) => Traversable (FreeT' f m) Source # | |
Defined in FMonad.FreeT | |
(MonadPlus m, Functor f) => Alternative (FreeT' m f) Source # | |
(Monad m, Functor f) => Applicative (FreeT' m f) Source # | |
(Functor f, Functor m) => Functor (FreeT' m f) Source # | |
(Monad m, Functor f) => Monad (FreeT' m f) Source # | |
(MonadPlus m, Functor f) => MonadPlus (FreeT' m f) Source # | |
(Read1 f, Read1 m, Read b) => Read (FreeT' m f b) Source # | |
(Show1 f, Show1 m, Show b) => Show (FreeT' m f b) Source # | |
(Eq1 f, Eq1 m, Eq b) => Eq (FreeT' m f b) Source # | |
(Ord1 f, Ord1 m, Ord b) => Ord (FreeT' m f b) Source # | |
Defined in FMonad.FreeT |