| Copyright | (c) Justin Le 2019 |
|---|---|
| License | BSD3 |
| Maintainer | justin@jle.im |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Control.Applicative.ListF
Description
Synopsis
- newtype ListF f a = ListF {
- runListF :: [f a]
- mapListF :: ([f a] -> [g b]) -> ListF f a -> ListF g b
- newtype NonEmptyF f a where
- NonEmptyF {
- runNonEmptyF :: NonEmpty (f a)
- pattern ProdNonEmpty :: (f :*: ListF f) a -> NonEmptyF f a
- NonEmptyF {
- mapNonEmptyF :: (NonEmpty (f a) -> NonEmpty (g b)) -> NonEmptyF f a -> NonEmptyF g b
- toListF :: NonEmptyF f ~> ListF f
- fromListF :: ListF f ~> (Proxy :+: NonEmptyF f)
- newtype MaybeF f a = MaybeF {}
- mapMaybeF :: (Maybe (f a) -> Maybe (g b)) -> MaybeF f a -> MaybeF g b
- listToMaybeF :: ListF f ~> MaybeF f
- maybeToListF :: MaybeF f ~> ListF f
- newtype MapF k f a = MapF {}
- newtype NEMapF k f a = NEMapF {
- runNEMapF :: NEMap k (f a)
ListF
A list of f as. Can be used to describe a product of many different
values of type f a.
This is the Free Plus.
Incidentally, if used with a Contravariant f, this is instead the
free Divisible.
Instances
| HFunctor (ListF :: (k -> Type) -> k -> Type) Source # | |
| HTraversable (ListF :: (k -> Type) -> k -> Type) Source # | |
Defined in Data.HFunctor.HTraversable | |
| HBind (ListF :: (k -> Type) -> k -> Type) Source # | |
| Inject (ListF :: (k -> Type) -> k -> Type) Source # | |
| FreeOf Plus (ListF :: (Type -> Type) -> Type -> Type) Source # | This could also be |
| Plus f => Interpret (ListF :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # | A free |
| Functor f => Functor (ListF f) Source # | |
| Applicative f => Applicative (ListF f) Source # | |
| Foldable f => Foldable (ListF f) Source # | |
Defined in Control.Applicative.ListF Methods fold :: Monoid m => ListF f m -> m # foldMap :: Monoid m => (a -> m) -> ListF f a -> m # foldMap' :: Monoid m => (a -> m) -> ListF f a -> m # foldr :: (a -> b -> b) -> b -> ListF f a -> b # foldr' :: (a -> b -> b) -> b -> ListF f a -> b # foldl :: (b -> a -> b) -> b -> ListF f a -> b # foldl' :: (b -> a -> b) -> b -> ListF f a -> b # foldr1 :: (a -> a -> a) -> ListF f a -> a # foldl1 :: (a -> a -> a) -> ListF f a -> a # elem :: Eq a => a -> ListF f a -> Bool # maximum :: Ord a => ListF f a -> a # minimum :: Ord a => ListF f a -> a # | |
| Traversable f => Traversable (ListF f) Source # | |
| Contravariant f => Contravariant (ListF f) Source # | Since: 0.3.0.0 |
| Eq1 f => Eq1 (ListF f) Source # | |
| Ord1 f => Ord1 (ListF f) Source # | |
Defined in Control.Applicative.ListF | |
| Read1 f => Read1 (ListF f) Source # | |
Defined in Control.Applicative.ListF | |
| Show1 f => Show1 (ListF f) Source # | |
| Applicative f => Alternative (ListF f) Source # | |
| Functor f => Alt (ListF f) Source # | |
Defined in Control.Applicative.ListF | |
| Apply f => Apply (ListF f) Source # | |
| Functor f => Plus (ListF f) Source # | |
Defined in Control.Applicative.ListF | |
| Pointed f => Pointed (ListF f) Source # | |
Defined in Control.Applicative.ListF | |
| Decidable f => Decidable (ListF f) Source # | Since: 0.3.0.0 |
| Contravariant f => Divisible (ListF f) Source # | Since: 0.3.0.0 |
| Invariant f => Invariant (ListF f) Source # | Since: 0.3.0.0 |
Defined in Control.Applicative.ListF | |
| Contravariant f => Divise (ListF f) Source # | Since: 0.3.0.0 |
| Decide f => Decide (ListF f) Source # | Since: 0.3.0.0 |
| Conclude f => Conclude (ListF f) Source # | Since: 0.3.0.0 |
| Eq (f a) => Eq (ListF f a) Source # | |
| (Typeable a, Typeable f, Typeable k, Data (f a)) => Data (ListF f a) Source # | |
Defined in Control.Applicative.ListF Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ListF f a -> c (ListF f a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ListF f a) # toConstr :: ListF f a -> Constr # dataTypeOf :: ListF f a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ListF f a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ListF f a)) # gmapT :: (forall b. Data b => b -> b) -> ListF f a -> ListF f a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ListF f a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ListF f a -> r # gmapQ :: (forall d. Data d => d -> u) -> ListF f a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ListF f a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ListF f a -> m (ListF f a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ListF f a -> m (ListF f a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ListF f a -> m (ListF f a) # | |
| Ord (f a) => Ord (ListF f a) Source # | |
| Read (f a) => Read (ListF f a) Source # | |
| Show (f a) => Show (ListF f a) Source # | |
| Generic (ListF f a) Source # | |
| Semigroup (ListF f a) Source # | |
| Monoid (ListF f a) Source # | |
| type FreeFunctorBy (ListF :: (Type -> Type) -> Type -> Type) Source # | |
Defined in Data.HFunctor.Final | |
| type Rep (ListF f a) Source # | |
Defined in Control.Applicative.ListF | |
mapListF :: ([f a] -> [g b]) -> ListF f a -> ListF g b Source #
Map a function over the inside of a ListF.
NonEmptyF
newtype NonEmptyF f a Source #
A non-empty list of f as. Can be used to describe a product between
many different possible values of type f a.
Essentially:
NonEmptyFf ~ f -- one f:+:(f:*:f) -- two f's :+: (f :*: f :*: f) -- three f's :+: (f :*: f :*: f :*: f) -- four f's :+: ... -- etc.
This is the Free Plus on any Functor f.
Incidentally, if used with a Contravariant f, this is instead the
free Divise.
Constructors
| NonEmptyF | |
Fields
| |
Bundled Patterns
| pattern ProdNonEmpty :: (f :*: ListF f) a -> NonEmptyF f a | Treat a
|
Instances
| HFunctor (NonEmptyF :: (k -> Type) -> k -> Type) Source # | |
| HTraversable (NonEmptyF :: (k -> Type) -> k -> Type) Source # | |
Defined in Data.HFunctor.HTraversable | |
| HTraversable1 (NonEmptyF :: (k -> Type) -> k -> Type) Source # | |
Defined in Data.HFunctor.HTraversable Methods htraverse1 :: forall h f g (a :: k0). Apply h => (forall (x :: k1). f x -> h (g x)) -> NonEmptyF f a -> h (NonEmptyF g a) Source # | |
| HBind (NonEmptyF :: (k -> Type) -> k -> Type) Source # | |
| Inject (NonEmptyF :: (k -> Type) -> k -> Type) Source # | |
| FreeOf Alt (NonEmptyF :: (Type -> Type) -> Type -> Type) Source # | This could also be |
Defined in Data.HFunctor.Final Associated Types type FreeFunctorBy NonEmptyF :: (Type -> Type) -> Constraint Source # | |
| Alt f => Interpret (NonEmptyF :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # | A free |
| Functor f => Functor (NonEmptyF f) Source # | |
| Applicative f => Applicative (NonEmptyF f) Source # | |
Defined in Control.Applicative.ListF | |
| Foldable f => Foldable (NonEmptyF f) Source # | |
Defined in Control.Applicative.ListF Methods fold :: Monoid m => NonEmptyF f m -> m # foldMap :: Monoid m => (a -> m) -> NonEmptyF f a -> m # foldMap' :: Monoid m => (a -> m) -> NonEmptyF f a -> m # foldr :: (a -> b -> b) -> b -> NonEmptyF f a -> b # foldr' :: (a -> b -> b) -> b -> NonEmptyF f a -> b # foldl :: (b -> a -> b) -> b -> NonEmptyF f a -> b # foldl' :: (b -> a -> b) -> b -> NonEmptyF f a -> b # foldr1 :: (a -> a -> a) -> NonEmptyF f a -> a # foldl1 :: (a -> a -> a) -> NonEmptyF f a -> a # toList :: NonEmptyF f a -> [a] # null :: NonEmptyF f a -> Bool # length :: NonEmptyF f a -> Int # elem :: Eq a => a -> NonEmptyF f a -> Bool # maximum :: Ord a => NonEmptyF f a -> a # minimum :: Ord a => NonEmptyF f a -> a # | |
| Traversable f => Traversable (NonEmptyF f) Source # | |
Defined in Control.Applicative.ListF | |
| Contravariant f => Contravariant (NonEmptyF f) Source # | Since: 0.3.0.0 |
| Eq1 f => Eq1 (NonEmptyF f) Source # | |
| Ord1 f => Ord1 (NonEmptyF f) Source # | |
Defined in Control.Applicative.ListF | |
| Read1 f => Read1 (NonEmptyF f) Source # | |
Defined in Control.Applicative.ListF Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NonEmptyF f a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [NonEmptyF f a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (NonEmptyF f a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [NonEmptyF f a] # | |
| Show1 f => Show1 (NonEmptyF f) Source # | |
| Functor f => Alt (NonEmptyF f) Source # | |
Defined in Control.Applicative.ListF | |
| Pointed f => Pointed (NonEmptyF f) Source # | |
Defined in Control.Applicative.ListF | |
| Invariant f => Invariant (NonEmptyF f) Source # | Since: 0.3.0.0 |
Defined in Control.Applicative.ListF | |
| Contravariant f => Divise (NonEmptyF f) Source # | Since: 0.3.0.0 |
| Decide f => Decide (NonEmptyF f) Source # | Since: 0.3.0.0 |
| Eq (f a) => Eq (NonEmptyF f a) Source # | |
| (Typeable a, Typeable f, Typeable k, Data (f a)) => Data (NonEmptyF f a) Source # | |
Defined in Control.Applicative.ListF Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NonEmptyF f a -> c (NonEmptyF f a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NonEmptyF f a) # toConstr :: NonEmptyF f a -> Constr # dataTypeOf :: NonEmptyF f a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NonEmptyF f a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NonEmptyF f a)) # gmapT :: (forall b. Data b => b -> b) -> NonEmptyF f a -> NonEmptyF f a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NonEmptyF f a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NonEmptyF f a -> r # gmapQ :: (forall d. Data d => d -> u) -> NonEmptyF f a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NonEmptyF f a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NonEmptyF f a -> m (NonEmptyF f a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmptyF f a -> m (NonEmptyF f a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmptyF f a -> m (NonEmptyF f a) # | |
| Ord (f a) => Ord (NonEmptyF f a) Source # | |
Defined in Control.Applicative.ListF Methods compare :: NonEmptyF f a -> NonEmptyF f a -> Ordering # (<) :: NonEmptyF f a -> NonEmptyF f a -> Bool # (<=) :: NonEmptyF f a -> NonEmptyF f a -> Bool # (>) :: NonEmptyF f a -> NonEmptyF f a -> Bool # (>=) :: NonEmptyF f a -> NonEmptyF f a -> Bool # | |
| Read (f a) => Read (NonEmptyF f a) Source # | |
| Show (f a) => Show (NonEmptyF f a) Source # | |
| Generic (NonEmptyF f a) Source # | |
| Semigroup (NonEmptyF f a) Source # | |
| type FreeFunctorBy (NonEmptyF :: (Type -> Type) -> Type -> Type) Source # | |
Defined in Data.HFunctor.Final | |
| type Rep (NonEmptyF f a) Source # | |
Defined in Control.Applicative.ListF | |
mapNonEmptyF :: (NonEmpty (f a) -> NonEmpty (g b)) -> NonEmptyF f a -> NonEmptyF g b Source #
Map a function over the inside of a NonEmptyF.
MaybeF
A maybe f a.
Can be useful for describing a "an f a that may or may not be there".
This is the free structure for a "fail"-like typeclass that would only
have zero :: f a.
Instances
| HFunctor (MaybeF :: (k -> Type) -> k -> Type) Source # | |
| HTraversable (MaybeF :: (k -> Type) -> k -> Type) Source # | |
Defined in Data.HFunctor.HTraversable | |
| HBind (MaybeF :: (k -> Type) -> k -> Type) Source # | |
| Inject (MaybeF :: (k -> Type) -> k -> Type) Source # | |
| Plus f => Interpret (MaybeF :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # | Technically, |
| Functor f => Functor (MaybeF f) Source # | |
| Applicative f => Applicative (MaybeF f) Source # | |
| Foldable f => Foldable (MaybeF f) Source # | |
Defined in Control.Applicative.ListF Methods fold :: Monoid m => MaybeF f m -> m # foldMap :: Monoid m => (a -> m) -> MaybeF f a -> m # foldMap' :: Monoid m => (a -> m) -> MaybeF f a -> m # foldr :: (a -> b -> b) -> b -> MaybeF f a -> b # foldr' :: (a -> b -> b) -> b -> MaybeF f a -> b # foldl :: (b -> a -> b) -> b -> MaybeF f a -> b # foldl' :: (b -> a -> b) -> b -> MaybeF f a -> b # foldr1 :: (a -> a -> a) -> MaybeF f a -> a # foldl1 :: (a -> a -> a) -> MaybeF f a -> a # elem :: Eq a => a -> MaybeF f a -> Bool # maximum :: Ord a => MaybeF f a -> a # minimum :: Ord a => MaybeF f a -> a # | |
| Traversable f => Traversable (MaybeF f) Source # | |
Defined in Control.Applicative.ListF | |
| Contravariant f => Contravariant (MaybeF f) Source # | Since: 0.3.3.0 |
| Eq1 f => Eq1 (MaybeF f) Source # | |
| Ord1 f => Ord1 (MaybeF f) Source # | |
Defined in Control.Applicative.ListF | |
| Read1 f => Read1 (MaybeF f) Source # | |
Defined in Control.Applicative.ListF | |
| Show1 f => Show1 (MaybeF f) Source # | |
| Applicative f => Alternative (MaybeF f) Source # | |
| Functor f => Alt (MaybeF f) Source # | |
Defined in Control.Applicative.ListF | |
| Functor f => Plus (MaybeF f) Source # | |
Defined in Control.Applicative.ListF | |
| Pointed f => Pointed (MaybeF f) Source # | |
Defined in Control.Applicative.ListF | |
| Decidable f => Decidable (MaybeF f) Source # | Since: 0.3.3.0 |
| Contravariant f => Divisible (MaybeF f) Source # | Since: 0.3.3.0 |
| Invariant f => Invariant (MaybeF f) Source # | Since: 0.3.3.0 |
Defined in Control.Applicative.ListF | |
| Contravariant f => Divise (MaybeF f) Source # | Since: 0.3.3.0 |
| Decide f => Decide (MaybeF f) Source # | Since: 0.3.3.0 |
| Conclude f => Conclude (MaybeF f) Source # | Since: 0.3.3.0 |
| Eq (f a) => Eq (MaybeF f a) Source # | |
| (Typeable a, Typeable f, Typeable k, Data (f a)) => Data (MaybeF f a) Source # | |
Defined in Control.Applicative.ListF Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MaybeF f a -> c (MaybeF f a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (MaybeF f a) # toConstr :: MaybeF f a -> Constr # dataTypeOf :: MaybeF f a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (MaybeF f a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (MaybeF f a)) # gmapT :: (forall b. Data b => b -> b) -> MaybeF f a -> MaybeF f a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MaybeF f a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MaybeF f a -> r # gmapQ :: (forall d. Data d => d -> u) -> MaybeF f a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> MaybeF f a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MaybeF f a -> m (MaybeF f a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MaybeF f a -> m (MaybeF f a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MaybeF f a -> m (MaybeF f a) # | |
| Ord (f a) => Ord (MaybeF f a) Source # | |
Defined in Control.Applicative.ListF | |
| Read (f a) => Read (MaybeF f a) Source # | |
| Show (f a) => Show (MaybeF f a) Source # | |
| Generic (MaybeF f a) Source # | |
| Semigroup (MaybeF f a) Source # | Picks the first |
| Monoid (MaybeF f a) Source # | |
| type Rep (MaybeF f a) Source # | |
Defined in Control.Applicative.ListF | |
mapMaybeF :: (Maybe (f a) -> Maybe (g b)) -> MaybeF f a -> MaybeF g b Source #
Map a function over the inside of a MaybeF.
MapF
A map of f as, indexed by keys of type k. It can be useful for
represeting a product of many different values of type f a, each "at"
a different k location.
Can be considered a combination of EnvT and
ListF, in a way --- a is like a MapF k f a with unique (and ordered)
keys.ListF
(EnvT k f) a
One use case might be to extend a schema with many "options", indexed by some string.
For example, if you had a command line argument parser for a single command
data Command a
Then you can represent a command line argument parser for multiple named commands with
type Commands =MapFStringCommand
See NEMapF for a non-empty variant, if you want to enforce that your
bag has at least one f a.
Instances
| HFunctor (MapF k2 :: (k1 -> Type) -> k1 -> Type) Source # | |
| HTraversable (MapF k2 :: (k1 -> Type) -> k1 -> Type) Source # | |
Defined in Data.HFunctor.HTraversable | |
| Monoid k2 => Inject (MapF k2 :: (k1 -> Type) -> k1 -> Type) Source # | Injects into a singleton map at |
| (Monoid k, Plus f) => Interpret (MapF k :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # | |
| Functor f => Functor (MapF k f) Source # | |
| Foldable f => Foldable (MapF k f) Source # | |
Defined in Control.Applicative.ListF Methods fold :: Monoid m => MapF k f m -> m # foldMap :: Monoid m => (a -> m) -> MapF k f a -> m # foldMap' :: Monoid m => (a -> m) -> MapF k f a -> m # foldr :: (a -> b -> b) -> b -> MapF k f a -> b # foldr' :: (a -> b -> b) -> b -> MapF k f a -> b # foldl :: (b -> a -> b) -> b -> MapF k f a -> b # foldl' :: (b -> a -> b) -> b -> MapF k f a -> b # foldr1 :: (a -> a -> a) -> MapF k f a -> a # foldl1 :: (a -> a -> a) -> MapF k f a -> a # elem :: Eq a => a -> MapF k f a -> Bool # maximum :: Ord a => MapF k f a -> a # minimum :: Ord a => MapF k f a -> a # | |
| Traversable f => Traversable (MapF k f) Source # | |
Defined in Control.Applicative.ListF | |
| (Eq k, Eq1 f) => Eq1 (MapF k f) Source # | |
| (Ord k, Ord1 f) => Ord1 (MapF k f) Source # | |
Defined in Control.Applicative.ListF | |
| (Ord k, Read k, Read1 f) => Read1 (MapF k f) Source # | |
Defined in Control.Applicative.ListF | |
| (Show k, Show1 f) => Show1 (MapF k f) Source # | |
| (Functor f, Ord k) => Alt (MapF k f) Source # | Left-biased union |
Defined in Control.Applicative.ListF | |
| (Functor f, Ord k) => Plus (MapF k f) Source # | |
Defined in Control.Applicative.ListF | |
| (Monoid k, Pointed f) => Pointed (MapF k f) Source # | |
Defined in Control.Applicative.ListF | |
| (Eq k1, Eq (f a)) => Eq (MapF k1 f a) Source # | |
| (Typeable a, Typeable f, Typeable k2, Data k1, Data (f a), Ord k1) => Data (MapF k1 f a) Source # | |
Defined in Control.Applicative.ListF Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MapF k1 f a -> c (MapF k1 f a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (MapF k1 f a) # toConstr :: MapF k1 f a -> Constr # dataTypeOf :: MapF k1 f a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (MapF k1 f a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (MapF k1 f a)) # gmapT :: (forall b. Data b => b -> b) -> MapF k1 f a -> MapF k1 f a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MapF k1 f a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MapF k1 f a -> r # gmapQ :: (forall d. Data d => d -> u) -> MapF k1 f a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> MapF k1 f a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MapF k1 f a -> m (MapF k1 f a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MapF k1 f a -> m (MapF k1 f a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MapF k1 f a -> m (MapF k1 f a) # | |
| (Ord k1, Ord (f a)) => Ord (MapF k1 f a) Source # | |
Defined in Control.Applicative.ListF | |
| (Ord k1, Read k1, Read (f a)) => Read (MapF k1 f a) Source # | |
| (Show k1, Show (f a)) => Show (MapF k1 f a) Source # | |
| Generic (MapF k1 f a) Source # | |
| (Ord k, Alt f) => Semigroup (MapF k f a) Source # | A union, combining matching keys with |
| (Ord k, Alt f) => Monoid (MapF k f a) Source # | |
| type Rep (MapF k1 f a) Source # | |
Defined in Control.Applicative.ListF | |
A non-empty map of f as, indexed by keys of type k. It can be
useful for represeting a product of many different values of type f a,
each "at" a different k location, where you need to have at least one
f a at all times.
Can be considered a combination of EnvT and
NonEmptyF, in a way --- an is like a NEMapF k f a with unique (and ordered)
keys.NonEmptyF
(EnvT k f) a
See MapF for some use cases.
Instances
| HFunctor (NEMapF k2 :: (k1 -> Type) -> k1 -> Type) Source # | |
| HTraversable (NEMapF k2 :: (k1 -> Type) -> k1 -> Type) Source # | |
Defined in Data.HFunctor.HTraversable | |
| HTraversable1 (NEMapF k2 :: (k1 -> Type) -> k1 -> Type) Source # | |
Defined in Data.HFunctor.HTraversable Methods htraverse1 :: forall h f g (a :: k). Apply h => (forall (x :: k). f x -> h (g x)) -> NEMapF k2 f a -> h (NEMapF k2 g a) Source # | |
| Monoid k2 => Inject (NEMapF k2 :: (k1 -> Type) -> k1 -> Type) Source # | Injects into a singleton map at |
| (Monoid k, Alt f) => Interpret (NEMapF k :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # | |
| Functor f => Functor (NEMapF k f) Source # | |
| Foldable f => Foldable (NEMapF k f) Source # | |
Defined in Control.Applicative.ListF Methods fold :: Monoid m => NEMapF k f m -> m # foldMap :: Monoid m => (a -> m) -> NEMapF k f a -> m # foldMap' :: Monoid m => (a -> m) -> NEMapF k f a -> m # foldr :: (a -> b -> b) -> b -> NEMapF k f a -> b # foldr' :: (a -> b -> b) -> b -> NEMapF k f a -> b # foldl :: (b -> a -> b) -> b -> NEMapF k f a -> b # foldl' :: (b -> a -> b) -> b -> NEMapF k f a -> b # foldr1 :: (a -> a -> a) -> NEMapF k f a -> a # foldl1 :: (a -> a -> a) -> NEMapF k f a -> a # toList :: NEMapF k f a -> [a] # null :: NEMapF k f a -> Bool # length :: NEMapF k f a -> Int # elem :: Eq a => a -> NEMapF k f a -> Bool # maximum :: Ord a => NEMapF k f a -> a # minimum :: Ord a => NEMapF k f a -> a # | |
| Traversable f => Traversable (NEMapF k f) Source # | |
Defined in Control.Applicative.ListF | |
| (Eq k, Eq1 f) => Eq1 (NEMapF k f) Source # | |
| (Ord k, Ord1 f) => Ord1 (NEMapF k f) Source # | |
Defined in Control.Applicative.ListF | |
| (Ord k, Read k, Read1 f) => Read1 (NEMapF k f) Source # | |
Defined in Control.Applicative.ListF Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NEMapF k f a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [NEMapF k f a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (NEMapF k f a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [NEMapF k f a] # | |
| (Show k, Show1 f) => Show1 (NEMapF k f) Source # | |
| (Functor f, Ord k) => Alt (NEMapF k f) Source # | Left-biased union |
Defined in Control.Applicative.ListF | |
| Foldable1 f => Foldable1 (NEMapF k f) Source # | |
Defined in Control.Applicative.ListF | |
| Traversable1 f => Traversable1 (NEMapF k f) Source # | |
| (Monoid k, Pointed f) => Pointed (NEMapF k f) Source # | |
Defined in Control.Applicative.ListF | |
| (Eq k1, Eq (f a)) => Eq (NEMapF k1 f a) Source # | |
| (Typeable a, Typeable f, Typeable k2, Data k1, Data (f a), Ord k1) => Data (NEMapF k1 f a) Source # | |
Defined in Control.Applicative.ListF Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NEMapF k1 f a -> c (NEMapF k1 f a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NEMapF k1 f a) # toConstr :: NEMapF k1 f a -> Constr # dataTypeOf :: NEMapF k1 f a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NEMapF k1 f a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NEMapF k1 f a)) # gmapT :: (forall b. Data b => b -> b) -> NEMapF k1 f a -> NEMapF k1 f a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NEMapF k1 f a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NEMapF k1 f a -> r # gmapQ :: (forall d. Data d => d -> u) -> NEMapF k1 f a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NEMapF k1 f a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NEMapF k1 f a -> m (NEMapF k1 f a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NEMapF k1 f a -> m (NEMapF k1 f a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NEMapF k1 f a -> m (NEMapF k1 f a) # | |
| (Ord k1, Ord (f a)) => Ord (NEMapF k1 f a) Source # | |
Defined in Control.Applicative.ListF Methods compare :: NEMapF k1 f a -> NEMapF k1 f a -> Ordering # (<) :: NEMapF k1 f a -> NEMapF k1 f a -> Bool # (<=) :: NEMapF k1 f a -> NEMapF k1 f a -> Bool # (>) :: NEMapF k1 f a -> NEMapF k1 f a -> Bool # (>=) :: NEMapF k1 f a -> NEMapF k1 f a -> Bool # | |
| (Ord k1, Read k1, Read (f a)) => Read (NEMapF k1 f a) Source # | |
| (Show k1, Show (f a)) => Show (NEMapF k1 f a) Source # | |
| Generic (NEMapF k1 f a) Source # | |
| (Ord k, Alt f) => Semigroup (NEMapF k f a) Source # | A union, combining matching keys with |
| type Rep (NEMapF k1 f a) Source # | |
Defined in Control.Applicative.ListF | |