Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.Functor.Misc
Description
Synopsis
- data Const2 a (b :: x) (c :: x) where
- unConst2 :: forall {x} k (v :: x) (v' :: x). Const2 k v v' -> k
- dmapToMap :: DMap (Const2 k v) Identity -> Map k v
- dmapToIntMap :: DMap (Const2 Key v) Identity -> IntMap v
- dmapToMapWith :: forall {k1} f (v :: k1) v' k2. (f v -> v') -> DMap (Const2 k2 v) f -> Map k2 v'
- mapToDMap :: Map k v -> DMap (Const2 k v) Identity
- weakenDMapWith :: forall {k1} v v' (k2 :: k1 -> Type). (forall (a :: k1). v a -> v') -> DMap k2 v -> Map (Some k2) v'
- data WrapArg (a :: k -> Type) (b :: k -> Type) c where
- mapWithFunctorToDMap :: forall {k1} k2 f (v :: k1). Map k2 (f v) -> DMap (Const2 k2 v) f
- intMapWithFunctorToDMap :: forall {k} f (v :: k). IntMap (f v) -> DMap (Const2 Key v) f
- mapKeyValuePairsMonotonic :: forall {k1} {k2} (k3 :: k1 -> Type) (v :: k1 -> Type) (k' :: k2 -> Type) (v' :: k2 -> Type). (DSum k3 v -> DSum k' v') -> DMap k3 v -> DMap k' v'
- combineDMapsWithKey :: GCompare f => (forall (a :: k). f a -> These (g a) (h a) -> i a) -> DMap f g -> DMap f h -> DMap f i
- data EitherTag (l :: k) (r :: k) (a :: k) where
- dmapToThese :: DMap (EitherTag a b) Identity -> Maybe (These a b)
- eitherToDSum :: Either a b -> DSum (EitherTag a b) Identity
- dsumToEither :: DSum (EitherTag a b) Identity -> Either a b
- newtype ComposeMaybe (f :: k -> Type) (a :: k) = ComposeMaybe {
- getComposeMaybe :: Maybe (f a)
Const2
data Const2 a (b :: x) (c :: x) where Source #
stores a value of a given type Const2
k v vk
and ensures
that a particular type v
is always given for the last type
parameter
Instances
Ord k2 => GCompare (Const2 k2 v :: k1 -> Type) Source # | |
Eq k2 => GEq (Const2 k2 v :: k1 -> Type) Source # | |
Show k2 => GShow (Const2 k2 v :: k1 -> Type) Source # | |
Defined in Data.Functor.Misc Methods gshowsPrec :: forall (a :: k1). Int -> Const2 k2 v a -> ShowS # | |
Read k => Read (Const2 k v v) Source # | |
Show k => Show (Const2 k v v') Source # | |
Eq k => Eq (Const2 k v v') Source # | |
Ord k => Ord (Const2 k v v') Source # | |
Defined in Data.Functor.Misc Methods compare :: Const2 k v v' -> Const2 k v v' -> Ordering # (<) :: Const2 k v v' -> Const2 k v v' -> Bool # (<=) :: Const2 k v v' -> Const2 k v v' -> Bool # (>) :: Const2 k v v' -> Const2 k v v' -> Bool # (>=) :: Const2 k v v' -> Const2 k v v' -> Bool # |
unConst2 :: forall {x} k (v :: x) (v' :: x). Const2 k v v' -> k Source #
Extract the value from a Const2
dmapToMapWith :: forall {k1} f (v :: k1) v' k2. (f v -> v') -> DMap (Const2 k2 v) f -> Map k2 v' Source #
weakenDMapWith :: forall {k1} v v' (k2 :: k1 -> Type). (forall (a :: k1). v a -> v') -> DMap k2 v -> Map (Some k2) v' Source #
WrapArg
data WrapArg (a :: k -> Type) (b :: k -> Type) c where Source #
WrapArg
can be used to tag a value in one functor with a type
representing another functor. This was primarily used with dependent-map <
0.2, in which the value type was not wrapped in a separate functor.
Constructors
WrapArg :: forall {k} (b :: k -> Type) (a1 :: k) (a :: k -> Type). b a1 -> WrapArg a b (a a1) |
Instances
GCompare f => GCompare (WrapArg g f :: Type -> Type) Source # | |
GEq f => GEq (WrapArg g f :: Type -> Type) Source # | |
Read (f a) => Read (WrapArg g f (g a)) Source # | |
Show (f a) => Show (WrapArg g f (g' a)) Source # | |
Eq (f a) => Eq (WrapArg g f (g' a)) Source # | |
Ord (f a) => Ord (WrapArg g f (g' a)) Source # | |
Defined in Data.Functor.Misc Methods compare :: WrapArg g f (g' a) -> WrapArg g f (g' a) -> Ordering # (<) :: WrapArg g f (g' a) -> WrapArg g f (g' a) -> Bool # (<=) :: WrapArg g f (g' a) -> WrapArg g f (g' a) -> Bool # (>) :: WrapArg g f (g' a) -> WrapArg g f (g' a) -> Bool # (>=) :: WrapArg g f (g' a) -> WrapArg g f (g' a) -> Bool # max :: WrapArg g f (g' a) -> WrapArg g f (g' a) -> WrapArg g f (g' a) # min :: WrapArg g f (g' a) -> WrapArg g f (g' a) -> WrapArg g f (g' a) # |
Convenience functions for DMap
mapKeyValuePairsMonotonic :: forall {k1} {k2} (k3 :: k1 -> Type) (v :: k1 -> Type) (k' :: k2 -> Type) (v' :: k2 -> Type). (DSum k3 v -> DSum k' v') -> DMap k3 v -> DMap k' v' Source #
combineDMapsWithKey :: GCompare f => (forall (a :: k). f a -> These (g a) (h a) -> i a) -> DMap f g -> DMap f h -> DMap f i Source #
Union two DMap
s of different types, yielding another type. Each key that
is present in either input map will be present in the output.
data EitherTag (l :: k) (r :: k) (a :: k) where Source #
Constructors
LeftTag :: forall {k} (l :: k) (r :: k). EitherTag l r l | |
RightTag :: forall {k} (l :: k) (r :: k). EitherTag l r r |
Instances
GCompare (EitherTag l r :: k -> Type) Source # | |
GEq (EitherTag l r :: k -> Type) Source # | |
GShow (EitherTag l r :: k -> Type) Source # | |
Defined in Data.Functor.Misc Methods gshowsPrec :: forall (a :: k). Int -> EitherTag l r a -> ShowS # | |
Show (EitherTag l r a) Source # | |
Eq (EitherTag l r a) Source # | |
Ord (EitherTag l r a) Source # | |
Defined in Data.Functor.Misc Methods compare :: EitherTag l r a -> EitherTag l r a -> Ordering # (<) :: EitherTag l r a -> EitherTag l r a -> Bool # (<=) :: EitherTag l r a -> EitherTag l r a -> Bool # (>) :: EitherTag l r a -> EitherTag l r a -> Bool # (>=) :: EitherTag l r a -> EitherTag l r a -> Bool # max :: EitherTag l r a -> EitherTag l r a -> EitherTag l r a # min :: EitherTag l r a -> EitherTag l r a -> EitherTag l r a # |
eitherToDSum :: Either a b -> DSum (EitherTag a b) Identity Source #
Convert Either
to a DSum
. Inverse of dsumToEither
.
dsumToEither :: DSum (EitherTag a b) Identity -> Either a b Source #
Convert DSum
to Either
. Inverse of eitherToDSum
.
newtype ComposeMaybe (f :: k -> Type) (a :: k) Source #
We can't use
instead of Compose
Maybe
,
because that would make the ComposeMaybe
f
parameter have a nominal type role.
We need f
to be representational so that we can use safe
.coerce
Constructors
ComposeMaybe | |
Fields
|